My understanding from looking at the datasheets is that the contents of the port register controls the pullup resistors whenever a pin is set to be an input.
If a bit was set to be an output and set to 1 when the corresponding bit in the DDR is set to 0, the pullup resistor would be enabled until the corresponding bit in the PORT register is cleared.
Likewise if a bit was set to be an output and set to 0 when the corresponding bit in the DDR is set to 0, the pullup resistor would be disabled until the corresponding bit in the PORT register is set.
In the case of a GLCD, 8 data bits are sometimes output and sometimes inputs.
The main question is what should be done with the internal pullups on input?
I would assume they should be disabled, but would it matter if they are enabled?
The reason I ask, is I have looked around at many LCD & GLCD examples, and most of them don't deal with this issue. In fact, my code isn't dealing with this either.
So what happens is that when the data bits are turned around from output to input, the bits that had 1s on them during the last write will have their pullups enabled and the bits that last had a 0 would not have the pullups.
To ensure the pullups are set consistently requires writing to the port bits prior to reading the pins.
This takes a little extra time, especially in environments where the 8 data bits/pins are not all on the same port so it would be nice if you can get away with using the pullups either way.
The reason I ask is I've seen some odd behavior on one particular ks0108 based GLCD and I'm wondering if there is a some kind of weird slew rate issue or open collector drive issue.
Here is the link to the odd behaving GLCD:
All timing uses minimum nanosecond delays specified from each datasheet. The topway display misbehaves until you increase its twh on data writes to 3500ns vs the specified 700ns.
This doesn't seem to make sense to me.
No - I haven't yet hooked up a scope yet to really see the signals yet as I'm still trying to debug things and figure out what is happening on this one particular GLCD. Several other GLCDs work fine with their minimum timing.
(And yes I'm not using
But in general what are peoples thoughts with respect to using/not using the internal pullups on the LCD data lines vs "randomly" using them. i.e. letting them be enabled/disabled by the contents of the last data written?