Shop OBEX P1 Docs P2 Docs Learn Events
Serial LCD 4 x 20 — Parallax Forums

Serial LCD 4 x 20

littlerichlittlerich Posts: 27
edited 2007-10-12 19:45 in BASIC Stamp
Hi,
I have one of the Parallax serial 4 x 20 LCD's and am having some trouble.

My stamp is a 2P40

If I put it in test mode it works so I assume the display is ok.

So I tried a basic example from one of the documents:
' {$STAMP BS2P} 'I added the P as all examples were for a BS2
' {$PBASIC 2.5}


TxPin CON 13
Baud19200 CON 32 'also tried 84 instead of 32


HIGH TxPin ' Set pin high to be a serial port
PAUSE 150 ' Pause for Serial LCD to initialize
SEROUT TxPin, Baud19200, [noparse][[/noparse]"Hello, this text will wrap."]

I get not a sausage.
Well I get some jibberish on the screen when I download and run. This makes me think I am connected to the right pin (got a little confused between Outputs 0-16/labelling etc) It is connected to pin 18 of the 2P40 which I guess if the first bank of pins is called 0 to 15 means I am on 13.

The LCD is set for 19,200.

I do have to admit how I powered it.
The stamp is powered on pin VDD by a 7805 reg with a couple of small filter caps. I have infact powered the display from that connection point and ground.
Is this a major?
Regulator is powering nothing else.
Now having read a bit more I see this is not recommended however as the regulator has 1amp rating I hope all is well.

Can someone see what has gone wrong here?
Cheers
Richard

Comments

  • Paul Sr.Paul Sr. Posts: 435
    edited 2007-10-12 12:18
    First thing, It looks like you have chosen the wrong BAUD rate (both of them).

    Parallax/Jon Williams published the following which I use in each project so I don't have to remember or look up the rate for the processor I use. You just use BAUD in your SEROUT which is set to the correct value.

    '   {$STAMP BS2P}
    '   {$PBASIC 2.5}
    '
    ' =========================================================================
    
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    
    #SELECT $STAMP
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T4800       CON     188
        T9600       CON     84
        T19K2       CON     32
        TMidi       CON     12
        T38K4       CON     6
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T4800       CON     500
        T9600       CON     240
        T19K2       CON     110
        TMidi       CON     60
        T38K4       CON     45
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T4800       CON     813
        T9600       CON     396
        T19K2       CON     188
        TMidi       CON     108
        T38K4       CON     84
    #ENDSELECT
    
    SevenBit        CON     $2000
    Inverted        CON     $4000
    Open            CON     $8000
    
    Baud            CON     T19K2
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    
    
    

    Post Edited (Paul Sr.) : 10/12/2007 12:25:34 PM GMT
  • littlerichlittlerich Posts: 27
    edited 2007-10-12 19:45
    Thank you very much, while not tried yet I am sure this will be the fix.
Sign In or Register to comment.