Shop OBEX P1 Docs P2 Docs Learn Events
4x20 Serial LCD with Keypad Interface Driver? (from Parallax) — Parallax Forums

4x20 Serial LCD with Keypad Interface Driver? (from Parallax)

TJHJTJHJ Posts: 243
edited 2008-11-07 18:56 in Propeller 1
So I have been looking for a driver object for this LCD and I cant seem to find one. If I have been staring at the obex for hours and its not there....... I have been having a heck of a time trying to make it work, and I am unable to decide if it is code error or something with the unit/my wiring.

Does anyone know if there is a driver for this LCD and where to download it?

It is the LCD from parallax.

www.parallax.com/Store/Accessories/Displays/tabid/159/CategoryID/34/List/0/Level/a/ProductID/55/Default.aspx?SortField=ProductName%2cProductName

Thanks
TJ

Post Edited By Moderator (Chris Savage (Parallax)) : 11/3/2008 5:57:43 PM GMT

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2008-11-01 11:34
    Hello TJHJ,

    as I took a short look into the manual

    the "driver" will be as simple as

    send bytes via a serial connection f.e. using FullDuplexSerial

    this democode should almost work directly

    ''HelloFullDuplexSerial.spin
    ''Test message to HyperTerminal.
    
    CON
       
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
       
    
    OBJ
       
      Debug: "FullDuplexSerial"
       
       
    PUB TestMessages
    ''HelloFullDuplexSerial.spin
    ''Test message to HyperTerminal.
    
    CON
       
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
       
    
    OBJ
       
      Debug: "FullDuplexSerial"
       
       
    PUB TestMessages
    
      ''Send test messages and to HyperTerminal.
     
      Debug.start(31, 30, 0, 57600)
    
      repeat
        Debug.str(string("This is a test message!", 10, 13))
        waitcnt(clkfreq + cnt)
    
    
    




    only things to change are
    rx-pin (in the demo the 31 and tx-pin (in the democode the 30 and baudrate (57600 in the demo-code)

    so as an example if your serial connection is on Propeller-IO-Pins 16 (rx) and 17 (tx) and the display has default baudrate is 19200

    the command has to be changed to
    Debug.start(16, 17, 0, 19200)

    Does the display work with the demosoftware from the Matrix Orbital CD ?

    as the manual says

    2.1 DB-9 Connector
    The LK204-25 provides a DB-9 Connector to readily interface with serial devices which use the EIA232
    standard signal levels of §12V to §12V. It is also possible to communicate at TTL levels of 0 to +5V by
    setting the Protocol Select Jumpers to TTL.

    Did you do that ?

    Maybe the 3.3V from the propeller might be too less if you connected the display DIRECTLY to Prop-IO-Pins

    best regards

    Stefan
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-01 12:37
    The Propeller should be able to drive the output pin (that works fine with other serial LCDs), but the display will need a +5v supply - it won't run off of the +3.3v supply you're using for the Propeller. That may be obvious, but it's worth mentioning.
  • Sleazy - GSleazy - G Posts: 79
    edited 2008-11-01 15:01
    I use protoboards to run the character serial LCD 4x20's that parallax sells.· Its got a 3.3v and 5.0v regulator on board.

    You can use simpleserial object, or even write your own serial object with spin or asm as alternatives.·

    When writing code, make sure that you have one cog running the LCD serial routine/method, and another cog running the keypad input.· This will ensure flicker-free LCD and a no-miss keypad scan.· It works quite nicely if you call cognew from a "main" or "start" style PUB block, to consecutively start the LCD·routine and the keypad scan.· That is unless you are really on a bare-bones power restriction.· This could be considered a "performance" protocol, and more cogs means more power.


    ·
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-11-01 15:29
    Hello,

    what sleazy describes is the disadvntage of simple serial it can only send or receive sequential

    it is NOT able of sending and receive at the SAME time

    that's the reason why I NEVER use simple serial
    I always use FullDuplexSerial

    start FullDuplexSerial and the rest of receiving is done in the backround
    you only have to take care of the buffer that you catch all received bytes
    if more bytes are received as the buffersize the oldest bytes where just overwritten

    if this doesn't matter read out the buffer when ever you want

    best regards

    Stefan
  • TJHJTJHJ Posts: 243
    edited 2008-11-01 17:50
    Removed to simplify.

    Post Edited (TJHJ) : 11/7/2008 2:14:36 AM GMT
  • TJHJTJHJ Posts: 243
    edited 2008-11-01 18:15
    So I tried the FD serial object as suggested. With the following code.

    ''HelloFullDuplexSerial.spin
    '' Modified to pin 16,17 to test a 4 x20 parallax graphical display.
    ''Test message to 4x20 graphical display.
    
    CON
       
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
       
    
    OBJ
       
      Debug: "FullDuplexSerial"
       
       
    
    PUB TestMessages
    
      ''Send test messages and to 4x20 graphical display
     
      Debug.start(16, 17, 0, 19200)
    
      repeat
        Debug.str(string("This is a test message!", 10, 13))
        waitcnt(clkfreq + cnt)
    
    



    And the following attached image is what I get. What is strange is it is not a repeating sequence as far as I can tell.

    Sorry its not the best picture, I couldnt find my camera, so I used my phone.

    One other note, I am unable to use the test software provided, as for the parallax version of this does not include the db9 connector. And the jumpers are in ttl, I have not modified it in any way in an attempt to minimize how many things are changing.

    mine looks like rev 2.x in this document.


    www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/LK204-25-Errata-V1.2.pdf

    edit NOTE: I did perform a reset using the jumper method, as show in section 2.6 of the manual, So according to that it would in fact be in 19,2k bps, ttl level.

    Thank you all again for looking at this, and helping.
    TJ

    Post Edited (TJHJ) : 11/1/2008 8:53:11 PM GMT
    600 x 800 - 110K
  • TJHJTJHJ Posts: 243
    edited 2008-11-07 02:13
    Bump, Anyone know why the following code generates complete gibberish on 4x20 graphical screen?

    Thanks
    TJ
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-11-07 17:57
    Hello TJHJ,

    so where is the code ?

    It also might be that it is a hardware problem

    Did you test the Display with a terminalprogram on a PC ?

    best regards

    Stefan
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-11-07 18:56
    Gibberish on a serial com is most frequently caused by a mismatch on the baud rate. I would double check that each device is communicating at the expected baud rate. If you find one setting isn't working try another (then when thats working, you can play around with getting the higher speed working).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.