Wednesday Mini Project: LCD displays
Oldbitcollector (Jeff)
Posts: 8,091
Every Wednesday... Wednesday Mini Projects:
This week I'm working with LCD displays.
http://www.gadgetgangster.com/news/54-wednesday-project/499-wednesday-mini-projects-.html
OBC
This week I'm working with LCD displays.
http://www.gadgetgangster.com/news/54-wednesday-project/499-wednesday-mini-projects-.html
OBC
Comments
Were those 4 line x 40 character LCDs? I've used the 4 x 20s before and they are quite useful. And since the human isn't a very fast reader, the 4-byte mode saves 4 I/O's for other use.
Those are 16x2 (1602) displays. Yes, I agree, the 4bit mode is fast enough for human interaction without wasting additional I/O space.
OBC
The 4-bit mode seems very popular although I myself have very rarely used it. There is a problem in that the display can get out of synch as to which is high nibble and which is low when there is a glitch either in software or just electrical noise. Rather than having an operator trying to figure out what's going on when gobbledygook appears while a machine is running wild I just play it safe and use 8-bit data
Besides I never waste Prop I/O and it's just as easy to slip in a one buck micro to handle the display although I do on occasion drive the LCD directly from the Prop.
I made 2_wire_LCD_1.5.f.
This curcuit use 2-wire(latch and clock). LCD-control-mode use 8bit.
I added level-shift too.
Many character-LCD(power:5V) use HD44780.
This D0-D7/RS is pulled up to 5V inside controller.
I think connecting prop's output and character-LCD's Data-line/RS is not good.
But everybody think no problem.
I'm wrong?
I put an object "3 I/O Pin Hitatchi compatible LCD driver" in the OBEX that uses the 4 bit mode. Never saw the sync issue Peter mentioned, however, I may alter/update it with a 16 bit s/r (two * 8 bit 74164 or 74HC299 for bi-dir comms) to enable use of 8 bit mode next time I need to play with LCDs. Also eliminates the loop in the object between nibbles(inlined the shifts, my preference is all. Could as easily have made a loop of it all). $0.50 and four traces may be good investment next time.
Frank
Wow, writing this was rather instructive of part trends. single 16 bit parts were > $2.00 each with weeks of lead time, 8 bit < $0.50 w/ "ya want how many? Take s'more!!!" Guess not much 16 bit market. Wonder what cost of EPLD for custom s/r controller?
From OBC's article:
"Note: Any time you are working with a +5v device it's a good idea to add resistors on the data connections to the Propeller. 3.3K resistors are a good choice most of the time. In my own test circuit, I briefly tested the unit with lines directly to the Propeller, then later added the resistors."
Even if adding resistor, output(High level) of prop is not less than suply voltage(3.3V).
So for LCD displays you can drive then in write only mode and save an I/O line on the R/W (tie it low) and resistors are not required. I have designed countless commercial LCD products and interfaces and believe me there is never a need to read from them and those tiny delays are all that are necessary. The LCD interface is a throwback from the the late 70's early 80's where they did indeed connect directly to processor buses that were just as slow as the LCD.
On the subject of freeing up Prop I/O rather than using shift registers I prefer to use the cheap $1 micros and that way I only need a single serial line to talk to them or even just place them on the same I2C bus as the EEPROM. If you like using shift register logic then consider using the I2C lines (P29,P28) as your data and clock to the shift register and then you only need another I/O for the enable, so in effect you have a one-wire LCD. This will not interfere with normal I2C operations (for good technical reasons) and neither will non-concurrent (obviously) I2C operations interfere with the LCD as it doesn't matter what junk is sitting in the register while the LCD enable is not activated.
Yes, I knew I was in overkill with adding 3.3k resistors to all of the lines, but it was done in the idea of getting folks used to protecting the Propeller in 5v usages.
OBC
Cut it out. You could be a real business builder if you just did not suggest things to protect your prop chip!!!!!
Just kiddin'
Frank