[sdiy] Odd problem with LCD
Tom Farrand
mbedtom at gmail.com
Mon Apr 6 03:34:21 CEST 2009
Tom,
Rather than a "floating" pin, I would be more suspect of a "crashing"
pin. Suppose the LCD was in a read register mode and the LCD itself
was asserting B0 low whereas the other pins were high. The LCD could
be fighting with the PIC, which would account for the "floating" 1.6V
you see.
I would look at the "crashing of logic levels" possibility. You
mentioned that port B was also used for other things. Do any of the
other things have the capability of making the LCD think you are
reading from its internal registers? Stick a 2K resistor in series
with B0 and see if "something" external to the PIC is trying to drive
B0 while you are driving B0. Are the other pins needed for LCD
control shared with other functions that could interfere?
As an aside ... do keep in mind that when you write to many PIC pins
to set their logic state, a READ-MODIFY-WRITE sequence is actually
what happens even when you expect that only a write operation is to be
performed. This causes the most problems when you are performing
Boolean operations on pin states (XOR, IOR, etc.) The higher the
circuit capacitance, the more likely there is opportunity for an
"unexpected" outcome. As you scratch your head wondering WTF, re-read
the data sheet section on READ-MODIFY-WRITE behavior. Not having
seen your schematic I cannot comment on the likelihood for an "aha"
moment, but it is an interesting read. Best of luck!
Peace.
Tom Farrand
On Sun, Apr 5, 2009 at 2:24 PM, Tom Wiltshire <tom at electricdruid.net> wrote:
>
> Hi all,
>
> If anyone can give me a clue to help with the following problem, I'd be grateful.
>
> I'm working on testing the main processor board of my monosynth. It has a PIC 16F74 that deals with MIDI, scanning the keyboard, the buttons, etc etc. It also has an LCD display attached.
>
> The LCD display is working fine, but the least-significant-bit seems to always be high. This means letters with an even-numbered ascii code finish up getting shifted up one place (L becomes M, but E is ok, D becomes E, but U is ok, etc).
>
> I have an 8-bit databus to which most of these parts are attached via 74HC541 buffer chips - the button matrix and the keyboard matrix both work like this. The LCD data lines (all 8 of them) is connected directly to this bus, since unless its clock and enable lines are pulsed, it will ignore data on the bus. The databus is connected to Port B on the PIC, which also has control of the chip select lines for all the '541s so it can choose which data to read, or can write to the LCD.
>
> Testing the troublesome databus line with a voltmeter shows 1.64V, which is what you'd expect for a line which was floating. But it shouldn't be floating, since the PIC should be pulling it high or low. Which it does for the other seven lines.
>
> I've tested the board without the PIC in place and both 74HC541 buffers are fine. I've tested the LCD on another board, and it's fine. I've tested the relevant pins of the PIC by making it switch LEDs on and off on my breadboard, and it's fine too. There's nothing special about that Port B pin except that it's the one used for external interrupts (INT).
>
> So why does this one line seem to float? Where's the problem likely to be? I've been round and round it, but I'm pretty much out of ideas now.
>
> Thanks,
> Tom
>
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list