Shop OBEX P1 Docs P2 Docs Learn Events
LCD problems using SEROUT 16 — Parallax Forums

LCD problems using SEROUT 16

hvguyhvguy Posts: 18
edited 2010-05-07 17:50 in BASIC Stamp
I have the Parallax 4x20 LCD, item 27979, connected to a BS2 and have had no problems with it until I tried to use the Sout pin.

This code:

DO
PAUSE 100
SEROUT 0, 32, [noparse][[/noparse]"hello"]
PAUSE 1000
LOOP

Displays hello every 1.1sec, as you would expect, with the LCD connected to P0

This code:

DO
PAUSE 100
SEROUT 16, 32, [noparse][[/noparse]"hello"]
PAUSE 1000
LOOP

Displays a cursor at L0 P0 and does nothing else, with the LCD connected to Sout

What's going on? Why does Sout not work the same as P0?

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2010-05-07 02:01
    Because Sout expects to have a PC connect to Sin -- the BS2 modulates the Sin signal to make the Sout signal. Also, Sout usually is +-5 volts or so, where pins zero through 15 are all TTL -- 0 to 5 volts.
  • hvguyhvguy Posts: 18
    edited 2010-05-07 04:08
    Thanks for the input. I checked Sout on the scope and found it's output to be the right level, 0-5V, however it was inverted. I checked the manual to see if this could be fixed with code and found: "If Tpin=16 is used, the data is inverted and driven regardless of baudmode setting". Given this statement I simply inverted the output with a 2N7000 and resistor, and now it works fine.

    Post Edited (hvguy) : 5/7/2010 4:55:21 AM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-05-07 12:26
    Wow, you're good. Yes, I was going to mention the "inversion despite the baudmode setting" thing.
  • hvguyhvguy Posts: 18
    edited 2010-05-07 17:49
    I'm new to this uC thing, but I have a lot of experience designing analog and digital electronics, I just needed someone (you) to point me in the right direction. Thanks!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-07 17:50
    I'm not sure where it went, but we have published the schematic for driving the LCD from the programming port using an NPN transistor to invert the signal. Takes a transistor and 2 resistors. A 2N3904 would work as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
Sign In or Register to comment.