Hello Folks, I was wondering if any lcd shield for the arduino would come with a shift register (alas 74HC595 or HEF4094) built in order to minimize the use of pins on the microcontroller. I know how to add and hook up a shift register ic, but was wondering if lcd shields would them built-in (it seems intuitive to have a shift register on a lcd shield board.)
No I don't think so.
However there are LCD interfaces that use the I2C lines so you don't loose any pins as the bus can also handle other interfaces at the same time.
many or most "shields" are not designed to be particularly "stackable" and are by and large, designed in the expectation that they are either the only one to be used, or perhaps with at most one other.
OK, this may not be true of all, but in particular, the commonly available LCD shield (thinking of the one using a 2 by 16 alphanumeric display with a HD44780 driver) is designed as the topmost of whatever shields might or might not be in the stack. So it uses at least 6 and generally 7 digital outputs, and one analog input for the buttons.
The obvious reason it has no provision for further shields on top, is that they would completely obscure the display - and buttons. And while it only occupies 7 or 8 port pins, it clearly is designed in the expectation that you do not propose to need too many of the others. Or mount it on a Mega 2560.
If you want both better flexibility and fewer port pins used, the obvious choice is one of the various display modules combined (either as you purchase them, or by assembling the two components) with a "backpack" using an PCF8574 I2C 8-bit port expander. Interestingly, the boards designed for this particular interface with the LCD module, are generally substantially cheaper than those offered as a more general I2C port expansion.
You can always make your own like one of these. A free CAD program, a bottle of etchant and "Bob's ya uncle" 8)
Pedro147, that looks pretty cool!
And this is my little project: HD47780 SPI Backpack - Album on Imgur
I would go with a display with a built in serial interface: I2C, SPI, RS232.
I think most displays listed here provide that capability, vs a parallel interface only.
That's a nice project there Mr Coolest 8) I like the photo set from inception to PCB implementation. I assume that one SR is for 8 bit data and the other for data control?
Pedro147 thanks. Indeed, the first SR is for data and the second is for RS and backlight. After finishing this and ordering the PCBs I discovered that using 4-bit wasn't really much or any slower than using 8-bits, but oh well. The SMD version of this board adds a few things such as optional backlight resistor, power led, the extra outputs of the 2nd SR are exposed with its Serial output port.
And also the size of it was reduced to 43x21mm, very close to the tiny PCF8574 I2C boards.
Nice. Don't make them too much smaller or we won't able to see em
Pedro147, definitely very cool! I have a similar set up, but using breadboard. The following:
I am not fancy of using stacked shields anyway, they seem cumbersome, limiting, and expensive; but I was always curious as why the lcd shield did not come with a shift register. Besides the final product will only be using the atemga328 chip on its own (no arduino or arduino derivative boards, well on a second thought I may can consider using an Arduino Mini Pro with an atmega328 since it has a good price point)
CrossRoads, Grump_Mike: the displays with a built-in serial interface is not cost effective, other than that they would be a nice alternative. For instance, I can buy a lot of 5pcs 16x2 off ebay for about US$12.
Paul_B: the fact that shields often monopolize the board make them counterproductive at least. Guess they are designed to make the arduino look more like a toy, such as lego and its building blocks. The PCF8574 (8 bits I/O port expander that uses the I2C protocol ) seems to cost as much as the 74HC595, so it may be an alternative. But I was wondering if it is as fast as using the digital I/O pins.
The Coolest: most people, me included, never noticed much of a different in using 4 bits in leiu of 8 bits (at least not with text).
Fine, buy a serial module on e-bay then.
http://www.ebay.com/itm/IIC-I2C-SPI-TWI-Interface-1602-Serial-Character-LCD-Module-Display-Blue-/271257953279?pt=LH_DefaultDomain_0&hash=item3f283be3ff
How much will the '595 cards add to the 5-lot of LCDs cost?
While you're at it, add a serial interface module to your parallel displays.
http://www.ebay.com/itm/Board-Module-Port-IIC-I2C-TWI-SP-I-Serial-Interface-For-Arduino-1602-LCD-HS-/221250141730?pt=LH_DefaultDomain_0&hash=item3383893e22
CrossRoads:
Fine, buy a serial module on e-bay then.
http://www.ebay.com/itm/IIC-I2C-SPI-TWI-Interface-1602-Serial-Character-LCD-Module-Display-Blue-/271257953279?pt=LH_DefaultDomain_0&hash=item3f283be3ff
How much will the '595 cards add to the 5-lot of LCDs cost?
A lot of 10 would could cost US$3 from a US seller, so .30 per unit. From Honk Kong, half that price: .15 per unit. A fairly cheap IC.
The IIC I2C SPI TWI Interface 1602 Serial Character LCD Module Display Blue for that price sounds much better, I shall buy one to play with it. But still, it would be more than twice the cost of the using a Shift Register; and I have to use a board anyway for other components besides the SR.
CrossRoads:
While you're at it, add a serial interface module to your parallel displays.
http://www.ebay.com/itm/Board-Module-Port-IIC-I2C-TWI-SP-I-Serial-Interface-For-Arduino-1602-LCD-HS-/221250141730?pt=LH_DefaultDomain_0&hash=item3383893e22
Interesting, I will look into it too.
Thks!
lazaruswald
I'm with you on the shields I only made mine because I was making a few simple PCB's at home and needed a project XD
There is a downside to the these I2C modules. When running them at 100KHz (default for PCF8574, non-A) you usually get around 1ms per char/command. When you use a SR with SPI you can make the same write in 8us, which means you'll have to wait for your HD44780 screen. It is about 25 times faster to use the SR than using the I2C port expander.
And I was always (until I actually tested it) under the impression that the LCD required a 38us waiting time after each write, not realizing that you can write both 4bit nibbles of a byte without any delays. That's why I originally went for a 2xSR design. Had I started it now I'd probably go with a single SR config.
Pedro147 and everyone who's interested,
I got the boards this week and today I put one together (don't have the 10uF cap and led yet as I didn't get those from ebay yet).
Here's how things look:
Two points.
What's the funny stuff over R4 and on the other side of the board?
I rather like the design of the boards with the interface connector on the other end (pin 16) so that it doesn't poke out the end of the assembly and make it more difficult to fit into a small case.
R4 is a backlight resistor, and my LCD already has a backlight resistor built in. I was in a bit of a hurry, and I haven't bought 0ohm resistors so I just used what I had at hand which was a bit of used solder wick You'll notice that on the back shot, I used another bit of solder wick to permanently close the backlight jumper. I added this jumper to the design because I was looking at other backpacks, which all had them.
As a response for your second point, you can use an upwards facing connector.
If your LCD goes into an enclosure you may want to embed a connector in the case, and solder the wires directly to the pads.
Just as a proof of concept, I modified the design a little (sort of a patch, not a complete redesign) to include the header on the left side.