Shop OBEX P1 Docs P2 Docs Learn Events
Wednesday Mini Project: LCD displays — Parallax Forums

Wednesday Mini Project: LCD displays

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2011-10-06 22:38 in Propeller 1
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

Comments

  • HShankoHShanko Posts: 402
    edited 2011-10-05 18:15
    Thanks Jeff for that write up.

    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.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-10-06 06:52
    @Harley,

    Those are 16x2 (1602) displays. Yes, I agree, the 4bit mode is fast enough for human interaction without wasting additional I/O space.

    OBC
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-06 08:00
    HShanko wrote: »
    Thanks Jeff for that write up.

    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.

    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.
  • caskazcaskaz Posts: 957
    edited 2011-10-06 08:20
    Hi.

    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?
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-10-06 09:42
    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

    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?
  • jazzedjazzed Posts: 11,803
    edited 2011-10-06 09:54
    caskaz wrote: »
    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?
    Depends ...

    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."
  • caskazcaskaz Posts: 957
    edited 2011-10-06 15:56
    Hi.
    Even if adding resistor, output(High level) of prop is not less than suply voltage(3.3V).
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-06 19:13
    LCD modules have very weak pullups so unless you are trying to read data from the LCD it is not a problem to connect them directly. The only thing you ever really need to read from LCD is the busy flag yet the busy flag is itself redundant as the maximum time the LCD will be busy for is clearly documented. All operations take no more than 37us but a return home takes 1.5ms so all you need to do is put a small delay after each write operation of less than 100us and the only time you normally issue the actual HOME command is during initialization where you need to have delays.

    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.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2011-10-06 20:28
    @Jazzed,

    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
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-10-06 22:38
    Jeff,

    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
Sign In or Register to comment.