Excellent site! This led me to the following, which has PIC-specific examples: http://www.iaehv.nl/users/pouweha/lcd.htm Thanks! -Ed V. At 12:22 PM 9/16/97 PST, you wrote: >Ed, I don't have the answer for you, but I bet you can find it here: > > http://www.paranoia.com/~filipg/HTML/LINK/F_Tech_LCD.html > > >CIAO - Martin R. Green >elimar@bigfoot.com > >---------- >From: Ed VanderPloeg[SMTP:evanderploeg@CREO.COM] >Sent: Tuesday, September 16, 1997 2:29 PM >To: PICLIST@mitvma.mit.edu >Subject: [OT] LCD "busy" signal > >I'm trying to use a PIC to drive a standard, run-of-the-mill, LCD display, >and am having trouble understanding the operation of the "busy flag". The >model is an Optrex DMC-20481 (or something like that) with an >industry-standard Hitachi HD44780 controller. Some important bits were >lost in the manual's translation from Japanese, so I'm left a little >confused. After sending a command or data byte to the LCD I think you can >do 1 of 2 things before sending the next: > >1. Wait a worst-case period of time before sending the next byte (not a >problem). >2. Read the "busy" flag before sending the next byte (problem). > >For efficiency I'm trying to wait for the busy signal as described in the >databook but it's not working as expected. Seems like the LCD is forever >busy. > >First of all, this busy signal is intended for use as I've described above, >yes? (or is it a busy signal for the 4-bit interface mode only?) Next, >when reading a byte from the LCD the PIC is still in control of the >"enable" signal, correct? (i.e. it's not driven by the LCD). Here's my >psuedo-code sequence for waiting for the LCD: > >1. Set TRIS register for LCD connection to input, control lines output. >2. Set the "data/command" line to low to indicate a command >3. Set the "read/write" to high to indicate a read >4. Set "data ready" high, wait a NOP (16MHz clock) for the LCD to spit out >the byte >5. Read in the LCD data byte to W >6. Pull the "data ready" signal low again >7. AND W with 0x80 (busy flag is bit 7) >8. If zero, it's not busy and we can continue, otherwise wait and read busy >flag again. > >But this seems to hang and think the LCD is forever busy. Ideas? > >-Ed V. > >