Pages: [1]   Go Down
Author Topic: Serial LCD Functions not working  (Read 1072 times)
0 Members and 1 Guest are viewing this topic.
Breda, The Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone.

I have a pop-bot with a serial LCD screen (SLCD16x2). I want to display text on it. The example program from the pop-bot .pdf manual works with the software Arduino 0023 and not with the Arduino 1.0.1 software. I would like to use it with Arduino v1.0.1. So I'm trying to convert it. But I failed.

This is the original example code:
Code:
/*******************************************************************************
* POP-BOT V1.0
* Filename : SimpleLCD.pde
* Show message on SLCD
********************************************************************************/
#include <SoftwareSerial.h>
#define rxPin 16
#define txPin 16
SoftwareSerial MySerial = SoftwareSerial(rxPin,txPin);
void setup(){
digitalWrite(txPin,HIGH);
delay(1000);
pinMode(txPin,OUTPUT);
MySerial.begin(9600);
delay(1000);
}
void loop(){
MySerial.print(0xFE,BYTE);
MySerial.print(0x80,BYTE);
MySerial.print("POP-BOT");
MySerial.print(0xFE,BYTE);
MySerial.print(0xC0,BYTE);
MySerial.print("Hello World !");
while(1);
}

I have tried replacing the last couple of lines with the following.
Code:
void loop(){
Serial.write(0xFE);
Serial.write(0x80);
Serial.print("Berendje");
Serial.write(0xC0);
Serial.print("GHalloo");
while(1);

But the only thing that is printed is 1 colored field in the left above corner.
What am I doing wrong?

There are many examples for LCD's, but they don't apply to my situation, because they are all for parallel controlled LCD's and I have a serial controlled one.

What have I tried:
-Reading a lot on this forum, but I haven't found topics answering my questions.
-Checking the example programs
-Reading the arduino FAQ's and the reference page.

Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50524
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
digitalWrite(txPin,HIGH);
delay(1000);
pinMode(txPin,OUTPUT);
You told the SoftwareSerial instance that these were its pins. Why are you then diddling with them?

Quote
The example program from the pop-bot .pdf manual works with the software Arduino 0023 and not with the Arduino 1.0.1 software.
Using SoftwareSerial in both cases? If so, they are not the same class, but any means.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5255
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#define rxPin 16
#define txPin 16
SoftwareSerial MySerial = SoftwareSerial(rxPin,txPin);

Don't do this, defining the RX and TX to the same pin. Although it may have worked in the old SoftwareSerial implementation, in the new one it doesn't.

BTW: pin 16 is A2 on the UNO. Have you really connected your LCD to that pin?
Logged

Breda, The Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey guys,

thanks for the replies.
Code:
digitalWrite(txPin,HIGH);
delay(1000);
pinMode(txPin,OUTPUT);
You told the SoftwareSerial instance that these were its pins. Why are you then diddling with them?

I have no idea, the first code in my post literally was the example code from the manual that came with the pop-bot.

Quote
The example program from the pop-bot .pdf manual works with the software Arduino 0023 and not with the Arduino 1.0.1 software.
Using SoftwareSerial in both cases? If so, they are not the same class, but any means.
Yes I have been using SoftwareSerial in both cases.
Now you mention it, I hope this is the problem. I read some more and I found out that Softwareserial is old and not supported any longer. LiquidCrystal library also is no use, because I think you can't use it with Serial controlled LCD's.
Now I'll go to figger out if I can make it work with Newsoftserial. The replacement library of softserial.

Code:
#define rxPin 16
#define txPin 16
SoftwareSerial MySerial = SoftwareSerial(rxPin,txPin);

Don't do this, defining the RX and TX to the same pin. Although it may have worked in the old SoftwareSerial implementation, in the new one it doesn't.

BTW: pin 16 is A2 on the UNO. Have you really connected your LCD to that pin?

I have connected my serial LCD with a JST3AA-8 cable to 16/A2. There is only 1 data cable. so that's why it is on the same pin.

I'll let you know if I can fix it with Newsoftserial.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5255
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have connected my serial LCD with a JST3AA-8 cable to 16/A2. There is only 1 data cable. so that's why it is on the same pin.

Give the RX pin another number, let's say 17 (if you don't use A3). This way the Arduino can install it's pin change interrupt there and won't conflict with the TX pin.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50524
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Now I'll go to figger out if I can make it work with Newsoftserial. The replacement library of softserial.
NewSoftSerial was renamed with 1.0, to SoftwareSerial. Just to confuse things.
Logged

Breda, The Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have connected my serial LCD with a JST3AA-8 cable to 16/A2. There is only 1 data cable. so that's why it is on the same pin.

Give the RX pin another number, let's say 17 (if you don't use A3). This way the Arduino can install it's pin change interrupt there and won't conflict with the TX pin.

Hey I'm using the arduino just to display text. There are no other serial readings/writings I want to do. The pop-bot kit I'm using has a JSTA3AA-8cable connecting the Serial LCD with the arduino. The cable has a 5+ and a GRND and in the middle 1 signal cable. TX and RX share the same cable. This shouldn't be a problem I think. The kit was designed like that.

For now I have put RX on 18 and TX on 16. And I can finally put some text on the LCD. I get strange characters, but my own message is also displayed. So that's a start. Finding the correct functions for this library is very hard. And I still had to figure it out myself, using like 5 different examples. I hope I can figure everything out on my own. Thanks for your help.


Logged

Breda, The Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found the answer to my questions here:
http://www.arduino.cc/playground/Learning/SparkFunSerLCD
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi, i'm very noob in this but you can show how put the code for working, i recently trying make work this but i can.
 even tring instaling the other libs
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i think so,he first code in my post literally was the example code from the manual that came with the pop-bot,
Logged

Pages: [1]   Go Up
Jump to: