serial lcd

I got an arduino Duemilanove recently and bought a serial lcd for it. It has three pins (a 5v, gnd, and serial) and I have connected the 5v and gnd to their respective pins but I don't know what to do with the serial. When I have it in the tx pin and am running the example code from the slcd library all I get is a bunch of triangles. But when I put it in the rx pin I get a display that says "LCD TEST MODE...". If anyone knows why this is happining your help would be much appreciated. Thanks!

Putting it in the RX pin isn't going to help. Your TX pin on the Arduino will send serial data out and the RX pin is expecting to receive serial data from another device. Unless you can read from your serial LCD, which maybe you can, but I'm sure you're not trying to do that (yet or at all).

Is this screen actually from SparkFun?

Have you tried just sending it anything over Serial by using something like the following:

void setup() {
  // open the serial port at 9600 bps:
  Serial.begin(9600);
  Serial.print("Hello World!");
  // Or try Serial.println("Hello World!");
}

void loop() {
  // Don't actually need to do anything in here
}

I've never used a serial LCD but I'm pretty sure the theory is that you're sending serial data to the PIC microcontroller that 'embedded' in the screen (you might not be able to see it) and it's handling the LCD part of it. It might not be that simple but if it's not, what's the point of Serial LCD?

Give it a whirl, let us know what happens.

If that doesn't work, try some other baud rates like 4800 or 19200. It should be in the documentation though I'd imagine it'd be 9600 by default.

I tried using the rate that was described in a book on basic stamps which is 2400 but all that gives me is a bunch of "x"s. Oh by the way the lcd can be found at http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/lcd/List/1/catpageindex/2/ProductID/50/Default.aspx?SortField=ProductName%2cProductName

Edit: I looked at the pdf on the web page and it says to move the switches on the back of the lcd, but when I do that nothing happens except if I move the pin2 to off it turns the back light off. (I also changed the baud rate with the corresponding switch codes that are explained on the 5th page of the pdf)

They say in that PDF to first power up the LCD. I assume you got that far. They then said to perform a simple test to confirm the LCD is working, to change the dip switches on the back. I can't recall which configuration, but it should make the LCD display Parallax Inc.. Did you get that far?

If you did, great. If not, try with the dip switches set to test configuration before powering it up.

You should then be able to set the baud rate using the same dip switches. They seem to favour 19200 so change the dip switches accordingly and then change the code to Serial.begin("19200"); and also put a delay(100); on the line below that, before sending hello world.

You can't be too far from it working...

wow, i feel realy dumb. :( It turns out that the lcd that I have isn't even paralax. It is a powertip that uses a seetron bpi-216. data sheet can be found here: http://www.seetron.com/bpk216_1.htm. Now I am even more lost. If anyone kows anything about the bpi-216 their help would be gratly appreciated thanks

Looks like you'd need to send your own commands over serial to it. What have you tried so far now that you've found the right documentation...?

I haven't tried anything because I don't know where to start.

Are you sure it's a BPE-216? This is the User's Manual...http://www.seetron.com/pdf/bpi_bpk.pdf

Put your BPS switch in the up position so it's running at 9600 baud.

You can test the unit for proper operation without a computer/serial port. Temporarily connect the serial input to one of the +5 terminals of J1, then connect power to +5 and GND. The LCD will display a test message.

Does that work?

The unit has two modes: text and instruction. It defaults to text mode; any data received appears on the screen. Send the string “HELLO” and “HELLO” appears on the LCD. To distinguish text from instructions (e.g., clear screen, position cursor, etc.), the interface looks for an instruction prefix (ASCII 254). The byte following this prefix is treated as an instruction. After the instruction code, the unit returns to text mode.

When the BPI-216 is first powered up, it requires about 750 milliseconds (ms) to initialize the LCD and get ready to receive data. Programs should wait about a second after powerup before sending data to the BPI-216.

I'd try this code:

void setup() {
  // open the serial port at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  delay(800);
  Serial.print("Hello World!");
}

I tried that code and all I get is a bunch of triangles and some questionmarks that occasionaly flash and other random flashing characters

Did you try the self-test as described in scootabugs first quote from the user manual?

yes I did and it said "LCD TEST MODE..." so I know that It works but I don't know how to make it display what i want to

I tried that code and all I get is a bunch of triangles and some questionmarks that occasionaly flash and other random flashing characters

Sounds like it is communicating at the wrong baud rate to me. Try different baud rates on the Arduino. One thing to remember with serial LCD's is make sure it is powered OFF when you are uploading new code to the Arduino as data is sent out over the Tx during the upload process and this may corrupt the serial LCD.

Sounds like it is communicating at the wrong baud rate to me. Try different baud rates on the Arduino.

This display can only work at 2400 baud or 9600 baud, selectable by a dip-switch. Instead of using a different baud rate on the Arduino, I suggest sticking to 9600 and flip the dip-switch instead. If it still doesn't work then the problem isn't the baud rate.

Btw is the serial-pin on the display connected to the Tx-pin on the Arduino and NOT the Rx-pin?

This is an arduino port of the code they got in their instruction manual.

void setup() {
  // open the serial port at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  delay(800);
  Serial.print(254,BYTE);Serial print(1, BYTE);//clear the screen
  delay(100);
  Serial.print(254,BYTE);Serial.print(128, BYTE);//move to first character on first line
  delay(100);
  Serial.print("Hello World!");
}

Hope this works. Also like skumlerud said, make sure the dip switch is set to operate at 9600 baud. Its the first dip switch. An image is available in the user manual scootabug linked to on pg 2.

I am very sorry that I haven't responded until now.

I have tried adjusting the baud rates and the dip switch but all I get is the same bunch of triangles but now it occasionally blinks some letters but they are always in a different spot.

Could it be the polarity of the TX signal?

what do you mean?

I think he means is it expecting a LOW instead of a HIGH and vice versa, on its RX pin. A nice thought but seemingly unlikely to me.

Are you able to get this screen working with any other uC platforms like Basic stamp etc?

how would I switch the polarity?

btw I am getting the cable for my basic stamp soon so I will be able to tell you if it works. :)