Shop OBEX P1 Docs P2 Docs Learn Events
Parallax 4x20 Serial LCD with Keypad Interface Graphical — Parallax Forums

Parallax 4x20 Serial LCD with Keypad Interface Graphical

TJHJTJHJ Posts: 243
edited 2009-01-05 03:03 in Propeller 1
So after having this thing for about 6 months now, and taking I can’t count how many attempts at making it work…
http://www.parallax.com/Store/Accessories/Displays/tabid/159/CategoryID/34/List/0/Level/a/ProductID/55/Default.aspx?SortField=ProductName%2cProductName
I can get nothing more than gibberish on the screen.
I have tried every baud rate I can think of. Various wiring configurations, including pull ups and downs. ·Standard serial driver, the Full duplex driver (every possible mode configuration), and anything else I can think of.
So has anyone ever made one of these work? How? Anyone have a driver that they know works for this screen?
·
Thanks
TJ
·

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-01 20:35
    I have one and have successfully done some code for the book I'm working on..

    Bah! Spoke too soon. I have the unit without the keyboard interface. Sorry.

    Post the code that is failing and let's see if the group can narrow it down..


    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS

    Post Edited (Oldbitcollector) : 1/1/2009 8:42:12 PM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-02 00:04
    Hello TJHJ,

    I'm absolutly sure that parallax sells reliable products. yeah.gif
    Nevertheless it might be that your LCD has a fault. yeah.gif

    Parallax itself has got it working. yeah.gif

    To narrow down the problem regardless of what the fault is: we need ALL kind of information.

    As long as you just cry out for a driver NOTHING changes. nono.gif
    As it's interface is TTL serial FullDuplexSerial MUST work if everything else is OK yeah.gif

    So PLEASE PLEASE PLEASE provide ALL the information

    the LCD needs a powersupply of 5V and minimum 100mA

    Did you test the LCD with a terminalsoftware and a voltage-levelshifter-cable ? (turning TTL 0V/5V into +12V/-12V)

    Did you test your propeller-chip with a terminalsoftware on a PC ?

    Did you talk or mail with the parallax tech-support As the most professionals you can get for advice ?

    Could you post a schematic of that setup which you think SHOULD work best?

    Can you ATTACH your COMPLETE code to a posting (not only pieces posted directly)

    Can you post pictures of your COMPLETE setup ?

    Do you have an oscilloscope for watching the bitbanging on the serial wire ?

    If you have no oscilloscope can you switch the serial line high/low every 3 seconds and measure the voltage with a DMM ?

    I'm sure we can find the fault but only if YOU provide enough information ! yeah.gif

    best regards

    Stefan

    Post Edited (StefanL38) : 1/2/2009 12:17:45 AM GMT
  • TJHJTJHJ Posts: 243
    edited 2009-01-02 02:20
    Stefan,
    StefanL38 said...

    Nevertheless it might be that your LCD has a fault.
    Why I asked if anyone else had any experience with one...
    StefanL38 said...


    Parallax itself has got it working.

    With a bs2, javalin... If they had a driver in the obex for the prop.....
    StefanL38 said...

    Did you test the LCD with a terminalsoftware and a voltage-levelshifter-cable ? (turning TTL 0V/5V into +12V/-12V)

    Did you test your propeller-chip with a terminalsoftware on a PC ?

    Since you do not own one of these, please note
    http://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/LK204-25-Errata-V1.2.pdf

    The one parallax sells has the 9 pin removed and is configured for TTL logic.

    See attached for the "Driver" I wrote....

    The following code generates this


    
    Pub Main
    
    lcd.Start(10,11, %0000, 19200)
    repeat
    
      lcd.str(string("A"))
    
    
    
      'wait for a key press
      waitpne(|< 0, |< 0, 0)
      waitcnt(clkfreq/10 +cnt)
      waitpeq(|< 0, |< 0, 0)   
    
    
    
    600 x 800 - 110K
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-02 02:49
    Just for giggles try changing your FullDuplexSerial line to this. {still looking}

    lcd.Start(10,11, %0001, 19200)

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • TJHJTJHJ Posts: 243
    edited 2009-01-02 21:38
    Oldbitcollector said...

    Just for giggles try changing your FullDuplexSerial line to this. {still looking}

    lcd.Start(10,11, %0001, 19200)

    In the case %0001 sometimes I get a vertical bar ( | ) on the display. Along with the hx thing. It is not consistent,So I am not sure what this means.


    The idea is every time I press the button I send the char So I can see what is being sent per loop.

    lcd.Start(10,11, %0000, 19200) ' or %0001
    repeat
     
      lcd.str(string("A"))
      
      waitpne(|< 0, |< 0, 0)
      waitcnt(clkfreq/10 +cnt)
      waitpeq(|< 0, |< 0, 0)
    
    
    



    Ok so here is what is weird. Sometimes I get an h, sometimes I get an x, or both, with neither one being always 1st. So on any key press I get one of the following options. h, x, hx, xh, hh, xx. I am very lost here.

    Also included are the requested pics of the setup, and serial com line.

    I also tried the Spark fun logic level converter. To test the possibility of it being a voltage mis match issue. Pictures included, on the next post, Limit 5 per post I guess.

    Thank you for the help,
    TJ

    Post Edited (TJHJ) : 1/2/2009 9:47:13 PM GMT
    640 x 425 - 21K
    640 x 425 - 25K
    640 x 425 - 29K
    425 x 640 - 24K
    640 x 425 - 19K
  • TJHJTJHJ Posts: 243
    edited 2009-01-02 21:45
    The pics of the spark fun logic level converter in place.

    TJ
    640 x 425 - 38K
    640 x 425 - 33K
    640 x 425 - 36K
  • Harrison.Harrison. Posts: 484
    edited 2009-01-02 21:53
    Have you tried %0011 as the FullDuplexSerial mode? That will invert both tx and rx.
  • TJHJTJHJ Posts: 243
    edited 2009-01-02 22:06
    Interestingly at least that results in a consistent character being displayed every key press. Its not a character I can find on the character map... So no idea

    See picture for char being printed per key press.
    Its the char that looks like a dash on the top of the char slot.


    TJ
    640 x 425 - 42K
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-03 17:28
    Any chance you can break this problem down into checkable parts?

    For instance, try communicating from PST to the LCD first and see
    if you can get proper communication from the PC to the LCD over
    the programming plug. (30,31)

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • TJHJTJHJ Posts: 243
    edited 2009-01-03 19:23
    Oldbitcollector said...

    For instance, try communicating from PST to the LCD first and see
    if you can get proper communication from the PC to the LCD over
    the programming plug. (30,31)

    I get the same results using the prop terminal, the random assortment of h and x, I used a prop plug to act as the USB to serial converter, I am not sure if this is really ok.


    I also downloaded the test software, and tried to run it using the prop plug as my converter. I get nothing but fast scrolling gibberish no matter what settings I use.
    Oldbitcollector said...

    Any chance you can break this problem down into checkable parts?

    I can try. StephanL38 has been kind enough to try and help me through PM as well. Here is the summary of things I have tried.

    The questions are StephanL38's. Thanks again Stephan....

    1.) check the frequency of the crystal for the prop
    maybe there is a wrong or bad chrystal mounted
    to check this: hook up an oscilloscope the check the timing of the serial bitbanging


    I am hesitant here, The prop runs terminal application fine for com, So I would assume that the timing is ok. Just to double check I hooked up a standard 4x20 display that I have used in the past and it works just fine.


    2.) maybe for some reason the voltage-levels for a HIGH is just around the threshold-value
    of 1.6V.
    Check this with an oscilloscope

    I am seeing a solid 3.301v as the high output, Picture on thread.

    As a test, I have the Spark Fun logic level converter, I placed it in between to kick the voltage all the way up to 5v, and there is no change in its behavior.

    3.)> If you change the rx and tx pin to Pin-No 31,30 so that your code of graphicLCDTest.SPIN looks like this

    lcd.Start(31,30, %0000, 19200)

    >you can check your driver with PST.EXE or any other serial terminalsoftware
    >in fact you can use the SAME serial connection that is used for programming the propeller for debugoutput via
    >FullDuplexSerial

    >If you get the same bytes on the PC as you sended them out YOUR DRIVER IS ALRIGHT

    When I switch the com lines to 31,30 and display it into the PST tool, It displays perfectly Fine.... Damn

    4.) >Did you check the "Protocol Select Jumpers" like described in the manual on page 11 chapter 2.3 ?
    >If you are using a direct connection to the Prop it should be configured for TTL
    >This means there have to be soldering bridges in across the soldering pads named "TTL"
    >and the soldering bridges across the soldering pads named "232" have to be removed

    >did you check if there is contact on "TTL" across the soldering pads ?


    Ok I took my multimeter and checked the connections using the toner. And it is not showing any measurable resistance. So I think this is good.

    5.)>did you check if there is NO contact on "232" across the soldering pads ?

    No tone, Visual inspection shows a solid separation, no connection error on resistance measurement.

    6.) Check the timing using an oscilloscope.

    It is ok and correct.

    7.) Tx and Rx lines. Tried both ways.

    8.)
    '' mode bit 0 = invert rx decimal value 1 or binary %0001
    '' mode bit 1 = invert tx decimal value 2 or binary %0010
    '' mode bit 2 = open-drain/source tx decimal value 4 or binary %0100
    '' mode bit 3 = ignore tx echo on rx decimal value 8 or binary %1000



    >did you test all these modes with THIS values?

    using the following code.

    
    Con
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    
    
    
    Obj
    LCD : "GrapicLCD"
    
    
    Var
    Long i
    long stack1[noparse][[/noparse]100]
    
    Pub Main
    cognew(Blink,@stack1)
    i := 0
     
    repeat
      lcd.Start(10,11, i, 19200)
      lcd.str(string("A"))
      
      waitpne(|< 0, |< 0, 0)
      waitcnt(clkfreq/10 +cnt)
      waitpeq(|< 0, |< 0, 0)
    
      if i > 15
        i := 0
    
      lcd.stop  
    
      
    
    Pub Blink
    dira~~
    repeat
      Repeat i
        outa~~
        waitcnt(clkfreq/3 +cnt)
        outa~
        waitcnt(clkfreq/3 +cnt) 
    
      waitcnt(clkfreq +cnt) 
    
    



    This just changed the mode every time I press the button, so I could ensure that I checked every possible mode.

    The blinking LED just let me keep up with what the value for i is.

    I used a similar method to test all the baud rates.

    Pub Main
    cognew(Blink,@stack1)
    i := 0
     
    repeat
      lcd.Start(10,11, %0000, BaudList(i) ) ' this is an array with the location value as i, the forum keeps deleting it when I post it. So I changed it to parenthesis from square brackets. 
      lcd.str(string("A"))
      
      waitpne(|< 0, |< 0, 0)
      waitcnt(clkfreq/10 +cnt)
      waitpeq(|< 0, |< 0, 0)
    
      if i > 9
        i := 0
    
      lcd.stop  
    
      
    
    Pub Blink
    dira~~
    repeat
      Repeat i
        outa~~
        waitcnt(clkfreq/3 +cnt)
        outa~
        waitcnt(clkfreq/3 +cnt) 
    
    
      waitcnt(clkfreq +cnt)  
    
    Dat
    
    BaudList long 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 
    
    



    and finally this code to check every possibility of either.
    Obj
    LCD : "GrapicLCD"
    Term : "Serial_Terminal"
    
    Var
    Long i, j, time
    long stack1[noparse][[/noparse]100]
    
    Pub Main
    cognew(output,@stack1)
    i := 0
    j := 0
    Time := cnt
    
    repeat i from 0 to 4
      repeat j from 0 to 9
        lcd.Start(10,11, SettingList(i), baudList[noparse][[/noparse]j]) 'Same problem here with the forum. The parenthesis after settingsList need to be changed to square brackets, but I cant post SquareBracket i squareBracket. The forums remove it from the post. 
        lcd.str(string("A"))
    
        waitcnt(time += clkfreq)
      'waitpne(|< 0, |< 0, 0)
      'waitcnt(clkfreq/10 +cnt)
      'waitpeq(|< 0, |< 0, 0)
      'i++
    
        lcd.stop  
    
      
    Pub Output
    Term.start
    repeat
      term.dec(i)
      term.str(String(","))
      term.dec(baudlist[noparse][[/noparse]j])
      term.out(13)
      waitcnt(time += clkfreq)
    
    
    




    Thank you all for trying to help me with this.

    TJ

    Post Edited (TJHJ) : 1/3/2009 7:32:36 PM GMT
  • RudyCRudyC Posts: 6
    edited 2009-01-04 05:43
    TJ,
    ·I purchased one of these unmodified from Digi-key and was was able to first plug it directly into my serial port and use the Matrix orbital software to play with it.· Out of the box it should have run at 19.2.· I then had to move the jumpers from the 232 to the TTL· points.· My connections are from P0 on the Prop·to the RX of the display and P1 of the prop·to the TX on the display.·

    I get the odd character that you show from yesterdays post (2:06) prior to when the Propeller initializes the serial port using the Full Duplex Serial driver.

    I have included a half finished spin project I was working on using this display and it's keyboard interface.· It includes a routine called matrix_lcd that is the modified·Parallax Serial LCD Driver v1.2·· made by Jon Williams and Jeff Martin.· I modified routines to work with the Matrix display, and added routines to make the keyboard function.· It isn't clean (but the display and keyboard work) because I decided to move on to C· with the project.·

    If this doesn't work, it almost sounds like the baud rate is messed up.· Try the manual override jumper located on page 13 on the matrix LK204-25 manual.· It said this will reset the Comm. settings.

    Hope this helps.


    Let me know if the attached zip file doesn't come through, it's my first attachment try at this forum.
  • TJHJTJHJ Posts: 243
    edited 2009-01-04 19:49
    AND IT WORKS

    THANK YOU THANK YOU

    I cant seem to spot where the difference is in the code... But Ill spend some time later looking at it.



    Thank·you so much RudyC.



    TJ
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-01-04 20:57
    Hello Rudy & TJ,

    as far as I compared the Serial LCD Driver from parallax and matrix_lcd

    matrix_lcd sends commands for setting up the keypad
    and then woodstove - main calls

    lcd.cursor(1) ' cursor off
    lcd.DisplayOn ' Display on (if available)

    as first operations.

    @TJ: I'm so curious about this could you please make a test what happens if you comment-out
    the putc commands in the init-method of matrix_lcd.spin and
    and
        lcd.cursor(1)                                       ' cursor off
        lcd.DisplayOn                                 ' Display on (if available)
    
    



    in the main-method of woodstove.spin ?

    the original Serial LCD Driver from parallax uses simple_serial instead of FullDuplexSerial
    so I guess it doesn't matter using simple_serial or FullDuplexSerial

    the debug_LCD-demo does

    PUB main | idx
                                                    
      if lcd.init(LCD_PIN, LCD_BAUD, LCD_LINES)             ' start lcd
        lcd.cursor(0)                                       ' cursor off
        lcd.backLight(true)                                 ' backlight on (if available)
        lcd.custom(0, @Bullet)                              ' create custom character 0
        lcd.cls                                             ' clear the lcd
    
    
    



    so is the bug simply a leading command lcd.cursor(0) ? ??

    TJ please check this for me ! I'm so curious about what the bug was

    Thank you in advance

    best regards

    Stefan

    Post Edited (StefanL38) : 1/4/2009 9:26:51 PM GMT
  • RudyCRudyC Posts: 6
    edited 2009-01-05 03:03
    Stefan,

    I started with the simple serial driver from the obex.· I then moved to the Full Duplex driver, to spread the tasks across to another cog.·

    the lcd.cursor routine is to change the cursor type on the screen.· the displayon routine turns on the backlight.· In the routine, the last putc has a value that is the number of minutes that the backlight stays on.

    The code wasn't complete because I moved on to C before I completed the spin code.· The reason the cursor and the display on are at the beginning, because I got it as far as functional.
Sign In or Register to comment.