Shop OBEX P1 Docs P2 Docs Learn Events
Hello World? — Parallax Forums

Hello World?

stevelsstevels Posts: 19
edited 2006-12-01 17:33 in General Discussion
This may be dumb question, but I just bought a SLCD-2 Serial LCD panel from Gravitech.us, as it was advertised as BASIC STAMP compatible. ·
·
I have read the manual cover to cover, and although I think I understand all their commands and so on, I have NO CLUE how to even hook it up to the BASIC STAMP, or how to even initiate a simple, “Hello World” program.
·
Does anyone have any good advice for a green, newbie like myself?

Thanks!
·
SA

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Expert in many fields, dumb as a stump with STAMP

Comments

  • jb1311jb1311 Posts: 20
    edited 2006-12-01 05:34
    I've never used one, but it seems versatile.

    I would first play a little with it using a serial cable connected to a PC running hyperterminal.

    The documentation stresses that power must applied correctly so use caution.

    I believer you have the version with a real RS 232 interface, do not wire that port directly to your stamp as it is +-10 volts and will likely damage the stamp.

    Page 7 shows how to hook the device to a microcontroller.
    Page 9 tells how to use the serial cable if you are connecting to PC or true RS 232 device. There is a caution on the page too.
  • David BDavid B Posts: 592
    edited 2006-12-01 17:33
    It looks like the basics of running this are to connect ground, power and an RS232 data line. The doc says you do need to provide RS232-level signals, so you need some sort of voltage translation from TTL to the display. You could use a MAX232 to do that, or it might be easier to use your PC serial port while you're getting accustomed to the display.

    So you need a power source that can supply 5 volts at 10 ma and a serial cable. Hook them up correctly. For the data line, sometimes it's a good idea to add a resistor, maybe 220 ohms, in series, so in case you accidently connect the PC output to a display output there's less chance of destroying anything from excess current. The PC should be ok; one of the nice things about the RS232 specification is that it is specified to allow any two pins to be shorted indefinitely with no damage occurring, but you never know how robust a unit like the display is.

    But if the display already provides a 9-pin D connector that is configured to accept a PC serial line, why not go ahead and try conencting your PC serial line right to it and see if it works.

    Power up the display. Start Hyperterminal. Go to your stereo and start a song, preferably a marching band, turned up loud. Just as the cymbols are about to crash, type "Hello World!" and see it appear on the display!

    But most likely something won't work, because so many things have to be set properly. Hyperterminal has to be sending to the port you're using, and its baud rate has to be set right. And some PC programs refuse to send unless you externally connect a jumper from pins 4 to 6 (DTR to DSR). It's really tough sometimes to dig out this requirement but it's often silently imposed on you, causing your program to break with no explanation as to why.

    But pretty soon you should start seeing something. It shouldn't be too hard to get it displaying.

    I have a Seetron serial LCD display, which is similar. To manage the device, both our units have chosen a byte as a control character. My Seetron uses "$FE", yours uses the question mark. To control the display position in the unit, the special character is detected, then the next character is taken as a special command to perform some internal display function. So if you send "a", then the unit will display an "a" on the LCD, but if you send "?a", the unit will clear the entire screen.

    So once you actually get characters displayed, you probably will want to make some helper routines. If you send a character string to the display, your routine will need to detect any data "?" and double it to display a "?", otherwise it will be taken as a command. You'll probably want routines to send a character, send a string, send numbers in decimal or hex, clear the display "?l", home the cursor "?a", position the cursor at any line or position, etc. There are a bunch of controls available to manage the cursor.

    That's all there is to it. Not too tough but it does take some preparation to work properly.

    David
Sign In or Register to comment.