I need to have 10 displays (16x2 LCD displays) and use the fewest pins i can. I thought of doing this with shift registers and found this website: http://www.stephenhobley.com/blog/2011/02/07/controlling-an-lcd-with-just-3-pins/, explaining how to drive a display with a shift register. Can someone confirm me that i can cascade 10 of those boards (each with a 74HC595 on it) to drive 10 displays? I know i have to change the bcp layout to have access to the seriel out pin, but that shouldn't be a problem. How many 74HC595 can be cascaded? Is there a max?
Thanks in advance, dusti
To drive these displays, you need to drive a minimum of 6 pins: D4 thru D7, RS, and EN. You can connect the corresponding pins of all the displays in parallel, except for EN, because EN is what tells the display to act on the data on the other pins. So you need 5 output pins to drive D4 thru D7 and RS, and 10 output pins to drive the EN pins - 15 pins in all. Depending on what other I/O you need to do, you might just have enough pins on the Arduino already.
If you don’t have enough pins, you could save 6 by using a 4 to 16 way demultiplexer to generate the 10 EN signals from just 4 pins.
This is great news! Thank you very much!
The text displayed on one display remains until i change it, even if i change the text on another display, right?
Yes, only the display which receives a pulse on the EN pin will respond to the command, the other displays will ignore it.
If you decide to use a demultiplexer to save 6 pins, there are a couple of points you need to note:
The EN signal to the display is active high, so you need a demux chip with active high outputs such as the 74HC4514. Most other demux chips have active low outputs.
When changing inputs to the demux, if you are not careful you can get glitches on the outputs. One way to avoid these is to use another output pin to drive the Enable output of the demux. Alternatively, update the displays in Gray code order so that you are only changing the value of one input to the demux at a time.
Using serial lcds you can use 10 pins for 10 displays. Will you have 10 pins?
Using shift registers you may be able to modify the liquidcrystal library to accept common data lines and use shift register to control 10 EN lines. Besides, you may need to instantiate 10 liquidcrystal objects. That might cost a lot of memory. I suggest you try to make 10 liquidcrystal objects and see how much that impacts your total remaining memory.
Do you also need keys at each lcd too?
Thanks for all your help!
I need ~15 buttons, but most of the time the displayed text stays the same and i have just to control if one button changed.
I don't think i need 10 LiquidCristal objects, because i think i can rewrite those methods in such a way that i have another argument "display" which represents the active display i need to write to, but i guess i just have to try :)
@dc42: thanks four your tips, i'll note that :)
You can read 15 buttons with 8 pins using a 5x3 multiplexing arrangement, with diodes in series with the buttons. You can even share 5 of the lines with the 5 common LCD display lines if you program it carefuly (the buttons won't get polled while you are updating a display, but that should be a short amount of time so it may be acceptable). So you can get away with 3 extra pins to read the 15 buttons.
We beat this topic to death a few months ago (http://arduino.cc/forum/index.php/topic,61977.0.html).
In my opinion you should look into the use of a device that is designed to do what you want to do (an I/O expander) rather than try to adapt a device that is designed for another job (a shift register). With a little bit of programming you can easily drive eight LCD modules with a single MCP23017 I/O expander and with some more complex programming you can add three more for a total of eleven.