Parallel LCD using the least stamp pins question
bytor95
Posts: 53
Hi,
I have been using a matrix-oribital serial LCD with my stamp and everything is great. I would like to reduce the cost to manufacture my tide predictor project so I started looking into parallel LCD's. My problem is that I would only have 4 pins left on my stamp. Is there a way to control a HD44780 compatible LCD with only 4 pins? If so, can you please point me toward the code to do so?
I would love to be able to interface to this LCD: http://www.crystalfontz.com/products/2002a-color/index.html#CFAH2002AAGHJP
Thanks in advance,
Engin
I have been using a matrix-oribital serial LCD with my stamp and everything is great. I would like to reduce the cost to manufacture my tide predictor project so I started looking into parallel LCD's. My problem is that I would only have 4 pins left on my stamp. Is there a way to control a HD44780 compatible LCD with only 4 pins? If so, can you please point me toward the code to do so?
I would love to be able to interface to this LCD: http://www.crystalfontz.com/products/2002a-color/index.html#CFAH2002AAGHJP
Thanks in advance,
Engin
Comments
RS (HD44780)
R/W (HD44780)
Data (74HC164 serial input)
Clk (74HC164 serial clock)
Clock your data into the shift register first (up to 8 bits). The 164's output pins will feed the HD44780's DB0-DB7 inputs. Then set and activate the RS and R/W lines as you normally would.
-Phil
Addendum: You could actually do it with three pins, by merging the R/W and Data pin.
Post Edited (Phil Pilgrim (PhiPi)) : 9/5/2007 8:26:00 PM GMT
Engin
It appears that I've erred slightly. I was going by an ancient document that didn't mention the E pin, and I assumed that RS was the strobe. So things are a bit more complicated, but I think it can still be done. Try this instead. Each line represents one Stamp pin:
E (HD44780)
Serial Data (74HC164) & RS (HD44780)
Serial Clock (74HC164)
Also, since this is a write-only setup, just tie R/W low. Now, all this assumes that you don't need to poll the HD44780's busy flag. I don't see any evidence of polling in the example code, so it may not be necessary. In any event, you can always add delays instead.
Anyway, the drill for writing to the LCD would be this:
1. Make sure E is low.
2. Clock eight bits of data into the shift register.
3. Set the Data pin to the desired value of RS.
4. Pulse E.
-Phil
You're the man. Thanks so much. I'll try it for sure.
Thanks a million!
Engin