> > The busy flag of an LCD (assuming you're using the HD44780 chipset) > > is bit 7 of the 8-bit interface. One thing I gotta know, why are you > > setting > > your pins to inputs? All you have to do is put the command/data > (low/high > > nibbles) on the data lines and strobe E (negative clock). > > > > > yes, the display uses the HD44780. The reason I want to set > the pins as inputs is because the PIC has output drivers: > Suppose the last command was to write the number '1' to > the display. That means my data lines are driven to 31h, > or 00110001b. Notice that bit 7 is 0 (regardless if i'm using > 8-bit or 4-bit interface). Now I want to read the busy flag. > The HD44780 tries to pull bit 7 high (because it's still > busy writing the '1' to the screen). However, the PIC is > trying to drive the pin low. Hence, I want to set the pins > as input. Does that make sense? > And i forgot to mention: this situation will mess up the LCD if you go from output to input, because the pin was 0, but changing it to an input makes it HiZ, which looks like a logic '1' to the LCD. Scoping it confirms this. If the LCD tries to pull the pin low, indicating it's no longer busy, you see a 250nsec pulse that makes it to Vcc for a few nsec, then decays to around 3 or 4 volts, then goes low.