I’m at a point on a project where I’m looking to add a second LCD (primarily to show debug data).
I’ve been doing some searching, and I did see a thread a few weeks ago but am unable to find it again regarding hooking up multiple HD44780 LCDs with 74HC164 shift registers. But I have been doing some hunting on Google and on the forums, and seen several times that when using the 3-wire method (this one) with a 74HC164 that they can all share the same Data & Clock lines, and you just need to provide each LCD with a unique output for the Enable line.
As the Enable line goes directly to the LCD and not through the 74HC164, and the Data & Clock lines are going to each 74HC164 and are all tied together, presumably each 74HC164 is sending out the same data, but only the LCD with the Enable line set is actually doing anything with that data. Which got me thinking, which would be the best way to wire this up?
Like it is on the left? or on the right? or does it not make a difference?
Based on how I’ve interpreted the info Google’s turned up, with no actual real schematics, photos or other examples, I’m going to assume the method on the right is the “correct” way to do it? If so, what are the problems that make the method on the left unworkable? Or should both methods work just fine?
I haven't tried it myself, but both method should work. Depending on layout and where those LCD's are located, there might not be any need to use two shiftregisters.
Also, to show debug data, you can just use the serial connection to the computer (serial monitor).
With regard to the debug data, serial connection won't be an option as I'll be testing it out in the field (literally), and packing as light as possible, so even a laptop wouldn't be doable.
I can't see any reason why you need the second shift register. It doesn't matter how you put the information on the data and RS lines as long as the enable lines are controlled separately. You have three unused outputs on the shift register, you probably could use two of them for the Enable lines although the programming would get a bit more complicated.
Floresta, I love you. That was the thread I mentioned in my first post that I'd seen ages ago but couldn't seem to find again - I guess I was mistaken on the use of 164s :)
After thinking about things for a while, I think I'm still going to go the route of having two 20x4 LCDs built into the unit. Once I'm done with development, the second LCD will still be useful for feeding back data during in regular use.
Updating this for the sake of a bit more completeness for those running across the thread in the future. I posted this in response to another thread, but putting it here too. Will post again when my other LCDs turn up.
This was the board I ultimately came up with for mine. Still waiting for the second LCD to arrive in the mail to give it a full testing though. But, it works with one LCD hooked up to either sockets, and it’s recognising which socket the LCD’s hooked up to and sending the appropriate output.
The 4N25’s are just to hook up to a camera for AF+Ground and Shutter+Ground connections. The light coloured lines are just wires to bridge gaps (working on single sided board).
Then lcd.print sends to one output, and lcd2.print sends to the other. Like I said, it’s sneding the output to the right set of pins when I switch the LCD over from one to the other, but still need to test running two at the same time.