----- Original Message ----- From: Peter McNulty To: Sent: Thursday, December 05, 2002 2:17 AM Subject: [EE]: LCD Initialization and Usage Sequence? Hi, ....snip.... The datasheet doesn't give much information, so could someone run throught he steps needed to get this working. According to the datasheet it should go: LCD Initialize: Power on -> Wait 15ms -> Send Function set -> Wait 5ms -> Send Function Set -> Wait 100micros -> Send Function set -> Wait 50micros -> Send Function Set -> wait 50micros -> Send Display Off -> wait 50Micros -> Send Clear Display -> Wait 2ms -> Set Entry Mode -> wait 50 Micros -> Finish But, it's it a bit weird that function set is being set 4 times, and I've never seen this in the code before. I've never seen so many waits in the code before either. As for the writing to the LCD, it only gives a little image which doesn't help at all. Also, it says send the E pulse or something. Is this simply, on for 1 clock cycle, off for 1 clock cycle on the E line? Also, for the write sequence, do i just send the data over DB0-7 or do i have to do something else with RS and R/W. I know the E pulse has to be sent when sending but that's it. ...snip.... Thanks -Peter Hi, the weird repetition maybe a result of the mode your controlling the LCD with. I know in 4-bit mode (usually uses DB4-7) you have to repeat codes to send to the LCD. Are you using 8bit (DB0:7)? 4bit? serial (doesn't sound like it)? The E line is used to 'clock' in your data on the data lines. It gives you time to setup what you want to send to the LCD on the data lines then when your code toggles the E line the LCD grabs what is waiting at the data lines. I'm not sure how long the E pulse should last, a data sheet for the HD44780 should say. I use LCDs that have KS0066U controllers. It says to pulse for 450ns. So a few 'nop's in your code should do the trick. If your just worried about writting to the LCD and not reading, then you can ground the R/W line. This simplifies things. The RS line is used to tell the LCD that the value you place on the data lines is either to be used as a command or as data to display on the screen. It should only go high when you want to display data. During the initilization it should be at 0. Hope it helps. Brendan -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.