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
Posted: Thu Sep 23, 2004 6:08 am
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.
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