Shop OBEX P1 Docs P2 Docs Learn Events
covert lcd 16x2 to lcd 20x4 line display — Parallax Forums

covert lcd 16x2 to lcd 20x4 line display

wb7076wb7076 Posts: 29
edited 2010-02-24 23:38 in Propeller 1
I need some help how do i convert this to a 4bit, 20x4 display. I wrote a nice code using this and i upgrade the display from the 16x2.

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-02-24 21:55
    You can simply write 4 more characters per line. If you have centered text, then add 2 to the move instruction.

    What else do you expect?
  • wb7076wb7076 Posts: 29
    edited 2010-02-24 22:23
    hmm, ill try that works for 4 line lcd just add more or is that going from 16x2 to 20x 2, iam going 16x2 to 20x4
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-02-24 22:56
    Ok .. a 4 line display has different addresses for the lines, as documented in the LCD_16x2...spin. I think MOVE has to be changed, as the address calculation really works for 2 lines only.

    if y>2 you need to subtract 2 from y befor using it to calculate adr and after calculation of adr add $14 to adr.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-02-24 23:38
    There is a 20x4 spin code example in the obex. Search for LCD. I'd quote the exact lines you need to change but for some reason I can't seem to log into the obex to download it (even though I'm logged in here). Maybe the obex needs a different login/password now?

    Anyway, going from 16x2 to 20x2 is just a matter of writing 4 more characters. Going from 20x2 to 20x4 adds two different lines to write to. Sing out if you can't find it. If you have your working code check the line number addresses and add two more. This is an excerpt from some working code I have so you can see the line numbers:
    PUB Redraw                        ' redraw the entire screen
        Inst:=128                     ' line 1
        Send_Inst
        LineNumber:=1                 ' print line 1
        Printline
        Inst:=192                     ' line 2
        Send_Inst
        LineNumber:=2                 ' print line 2
        Printline
        Inst:=148                     ' line 3
        Send_Inst
        LineNumber:=3                 ' print line 3
        Printline
        Inst:=212                     ' line 4
        Send_Inst
        LineNumber:=4                 ' print line 4
        Printline
        Inst:=212                     ' cursor to beginning of line 4
        Send_Inst
        CursorOn
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller

    Post Edited (Dr_Acula) : 2/24/2010 11:49:38 PM GMT
Sign In or Register to comment.