CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LCD driver question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
glenjoy



Joined: 18 Oct 2004
Posts: 21

View user's profile Send private message

LCD driver question
PostPosted: Tue Feb 10, 2009 8:54 am     Reply with quote

I am trying to debug my hardware.

I have some subroutines bebore executing the lcd_init(); by CCS, my question is, when I am trying to execute lcd_init(); without connecting my LCD to the micro, the micro hangs/crashes, is this normal?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 10, 2009 12:39 pm     Reply with quote

It's probably stuck in a loop, testing the LCD's Busy bit.

If you're using the Flex driver in the Code Library, you can disable
checking the busy bit by commenting out the following line:
Code:
// #define USE_RW_PIN   1   

Then re-compile. Now it shouldn't lock up in your situation (with no LCD).
The lcd_init() routine does have several delay_ms() statements in it.
These delays could give the appearance of "locking up" in some
simulators.

If you re-connect the LCD:
If you want to use the LCD without testing the busy bit, comment out
that line and then connect the R/W pin to ground on your LCD.
Or, if the R/W line is already hard-wired to the PIC and you can't remove
the connection, then use an output_low() statement to set the R/W signal
to a constant low level.
glenjoy



Joined: 18 Oct 2004
Posts: 21

View user's profile Send private message

PostPosted: Wed Feb 11, 2009 1:29 am     Reply with quote

I am using CCS ver. 4.084 LCD.C driver, I am using Port B for the LCD, are there any other changes I must do aside from;

// Un-comment the following define to use port B
// #define use_portb_lcd TRUE

// Un-comment the following define to use port B
#define use_portb_lcd TRUE
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 11, 2009 1:58 am     Reply with quote

See my post at the end of this thread. It tells how to modify the original
CCS driver (lcd.c) so it doesn't use the RW line. This requires that the
LCD have the RW pin grounded.
http://www.ccsinfo.com/forum/viewtopic.php?p=45146

CCS drastically changed their LCD.c driver starting with compiler
version 4.085, but you have vs. 4.084 which has the old CCS driver,
so the changes suggested in the link should work.
glenjoy



Joined: 18 Oct 2004
Posts: 21

View user's profile Send private message

PostPosted: Wed Feb 11, 2009 8:20 am     Reply with quote

This is the LCD.C that comes with my CCS, is this the new one or the old one?

Code:

///////////////////////////////////////////////////////////////////////////
////                             LCDD.C                                ////


++++++++++++++++++
Code deleted.
Reason: Forum Rule #10
10. Don't post the CCS example code or drivers

-- Forum Moderator
++++++++++++++++++
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 11, 2009 11:00 am     Reply with quote

That is the "old" one. It's the one that was shipped for vs. 4.084 and
earlier versions.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group