Shop OBEX P1 Docs P2 Docs Learn Events
Parallax 2X16 LCD & Stamp PLC problems — Parallax Forums

Parallax 2X16 LCD & Stamp PLC problems

MinimumWageMinimumWage Posts: 72
edited 2007-06-13 22:54 in General Discussion
Hello,

I am developing a simple·control system using a Stamp PLC with operator feedback displayed on·a Parallax 2X16 serial LCD. I've developed similar systems already using a Scott Edwards serial·LCD and had no problems getting the LCD to work with the PLC, but I cannot get any data to display using a Parallax LCD + PLC.

I will attach my code. I have tested the LCD and wiring harness with a Basic Stamp on a BOE, and it worked fine. I have good voltage on the LCD and it does power up and display the cursor, I just cannot get any of the SEROUT data to display. If anyone sees anything that might be tripping me up, please speak up!

Regards,

Mike Mc.

Comments

  • MinimumWageMinimumWage Posts: 72
    edited 2007-06-12 23:34
    I should also add that I did try the code at three baud rates (2400, 9600, 19200) and got the same results each time. The DIP switches on the LCD were set accordingly.

    Mike Mc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-13 04:39
    Hello,

    Due to the nature of the isolated outputs, probably the only way you’re going to get our Serial LCD (and most others) to work is by using a transistor driver on the output of the programming port. It is the only line not isolated (except the RX line). We have tested this and it works. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MinimumWageMinimumWage Posts: 72
    edited 2007-06-13 05:25
    Chris,

    Thanks for the response, and I'll try the driver circuit tomorrow. But I'm a little confused by your response about the programming port output - is it isolated like the other digital inputs? You seem to indicate at first that it is, and then say that it's not.

    Regards,

    Mike Mc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-13 15:36
    All of the I/O on the PLC is optically isolated except the programming port. The programming port output is inverted though, but the LCD requires non-inverted. So if you use the transistor it will correct it. But no, the programming port is not isolated. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MinimumWageMinimumWage Posts: 72
    edited 2007-06-13 17:46
    Chris,

    Thanks again for the explanation. The Seetron LCD must be set to work with an inverted input, or be able to handle either type of input. I can't find any details in the data sheet.

    In any case, the circuit you provided works but only at 2400 baud. The cursor is present at 9600 and 19200 but I get no display. Could it have something to do with the switching speed of the 3904? It's not critical to my application but it would be nice to know what's going on.

    Regards,

    Mike Mc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-13 20:01
    Mike,

    Are you using DEBUG or SEROUT to talk to the display? All should work through that port. DEBUG is only 9600 bps though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MinimumWageMinimumWage Posts: 72
    edited 2007-06-13 21:19
    Chris,

    SEROUT. The commented-out debugs in my code were for testing without the LCD connected. I did find a small error with my syntax where I forgot to put the LCD position code inside the square braces, but that didn't make any difference on the baud issue. Still works ok at 2400 baud, but no communication at any higher rate.

    Here's my corrected SerOut subroutine:

    CheckState:
    'DEBUG "In CheckState", CR
    HIGH Load
    SHIFTIN Dat, Clk, MSBPRE, [noparse][[/noparse]inBits]
    LOW Load

    'IF inBits.BIT0 = 1 THEN DEBUG "Xtal#1 Active",CR
    'IF inBits.BIT1 = 1 THEN DEBUG "Xtal#2 Active",CR
    'IF inBits.BIT2 = 1 THEN DEBUG "Xtal#3 Active",CR
    'IF inBits.BIT3 = 1 THEN DEBUG "Xtal#4 Active",CR
    'IF inBits.BIT4 = 1 THEN DEBUG "Xtal#5 Active",CR
    'IF inBits.BIT5 = 1 THEN DEBUG "Xtal#6 Active",CR
    'IF inBits = $00 THEN DEBUG "Sensor cable disconnected.",CR

    IF inBits.BIT0 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#1 Active "]
    IF inBits.BIT1 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#2 Active "]
    IF inBits.BIT2 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#3 Active "]
    IF inBits.BIT3 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#4 Active "]
    IF inBits.BIT4 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#5 Active "]
    IF inBits.BIT5 = 1 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Xtal#6 Active "]
    IF inBits = $00 THEN SEROUT LCDPin, Baud2400, [noparse][[/noparse]LCDHome1, "Check xtal cable"]
    'PAUSE 1000
    RETURN
  • MinimumWageMinimumWage Posts: 72
    edited 2007-06-13 21:59
    Chris,

    Oops - I just remembered something. After I added the inverter circuit this morning, my code & LCD were still set up for 2400 baud. I think now when I tried changing the baud rate in the code I probably forgot to change the LCD DIP switches. I just got the whole thing up and running and it responds fine at 2400 baud, so I don't want to unplug all the wiring again just to test. I'm pretty sure it would work at the higher rates if everything was set correctly.

    Thanks again for all the help!

    Regards,

    Mike Mc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-13 22:54
    Mike,

    Also remember if you change the DIP switches you will need to cycle power to the LCD Display. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.