I have known some LCDs that requires TWO SECONDS of timeout BEFORE any data is sent to them after initial power-up.
jmgelba - never assume your defines are correct which is why you should really provide everyone on the forum with as much information to your problem as possible without folks trying to second-guess your setup. You MUST check the SPELLING because PICBasic will not nescessarilly flag an error in a DEFINE statement - and of course your hardware connections EXACTLY match your DEFINE statements... you've not done something silly like cross-connect RS and E lines? Or reverse-connect the Datalines, or connect them to D0 thru D3 rather than D4 thu D7? We've all done it sometime!
The defines listed below function on almost every LCD I've tried (alter the Hardware pins to suit your own layout), but do try with a longer initialisation timeout... you've nothing to lose except a couple of seconds...
Finally, a lot of folks do regard the 'F' in RTFM as a swear word... it's original usage was as such even if you claim it isn't in your interpretation of it. Even I wince at it's public usage sometimes. I also want to scream "Read the ** Manual", or "Read the ** Datasheet", or "Search the ** forum posts" or "Why don't you just try it and see if it ** works instead wasting bandwidth" (insert your favourite word[s] at asterisk position) at folks so many times on this forum, it's best not to reply or bite your lip and moderate what you really would like to say rather than offend. Let's appear to be nice even if we aren't sincere about it. *smiles* Melanie - who's always nice to everyone equally - yeah right!Code:' ' LCD Display ' ----------- Define LCD_DREG PORTC ' Port for LCD Data Define LCD_DBIT 4 ' Use upper 4 bits of Port Define LCD_RSREG PORTC ' Port for RegisterSelect (RS) bit Define LCD_RSBIT 3 ' Port Pin for RS bit Define LCD_EREG PORTC ' Port for Enable (E) bit Define LCD_EBIT 0 ' Port Pin for E bit Define LCB_BITS 4 ' Using 4-bit bus Define LCD_LINES 2 ' Using 2 line Display Define LCD_COMMANDUS 2000 ' Command Delay (uS) Define LCD_DATAUS 50 ' Data Delay (uS)




Bookmarks