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 CCS Technical Support

LCD display

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



Joined: 08 Sep 2003
Posts: 6

View user's profile Send private message

LCD display
PostPosted: Thu Sep 23, 2004 1:25 am     Reply with quote

I need to remove and connect a LCD display. The problem is however when I remove the LCD the standard CCS LCD.C code still searches for the LCD and my program hangs. How can I check on startup if the LCD display is fitted or not and then ignore the search for the LCD display.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 23, 2004 6:08 am     Reply with quote

The problem is here:
Code:

void lcd_send_byte( BYTE address, BYTE n ) {

      lcd.rs = 0;
      while ( bit_test(lcd_read_byte(),7) ) ;


You could put a timeout in there and set a flag indicating the LCD is not available.

You could add a few NOP's and a counter that would allow the routine to bail out after a period of time.

You could rewrite the routine to just give a delay after each byte to ensure the LCD is not busy.

There are probably many other ways as well. The choice is up to you.
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