Pages: [1]   Go Down
Author Topic: Serial LCD BPK help !!!!!!!  (Read 872 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I am working on a project on Home Automation using arduino . I am using a serial LCD display (4x20 white on blue) from http://www.milinst.co.uk/. I dont know how to interface with arduino. I used the data sheet and i am not getting the output. can anyone guide me by step by step process with a sample code so that i can understand well.

* serial LCD.pdf (34.26 KB - downloaded 2 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


- http://arduino.cc/en/Tutorial/ASCIITable -

connect GND and 5V from Arduino to LCD

connect arduino pin 1 = TX to LCD RX

succes,
Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6898
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How did you connect the display to arduino and what code did you use. We don't have a crystal ball here so you have to show some pics and code.

"either 2400 or 9600 baud, no parity, 8 bits, 1 stop bit and inverted format."

I wonder if you noticed inverted format or baud rate (jumper setting)
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i had three pins. +,GND,Serial out. i connected +,GND to arduino +5V and GND respectively. Serial to arduino TX pin. 2400 baud rate is OFF and 9600 is ON in my serial LCD. I used the below code

void setup() {
  Serial.begin(9600);
               
  Serial.print(1, BYTE);  //Clear Screen
  delay(5);
  Serial.print("Hello world");

}

I dint get any output. help me !

void loop() {
}

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

to ROB

I did what you have said. but i am not getting the output. I have attached the Data sheet. please give me a sample program using the data sheet i have attached.

* serial LCD.pdf (34.26 KB - downloaded 4 times.)
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6898
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you have a delay in the setup to allow the serial lcd to start up as described in the manual? Also did you see what I replied, inverted format? I don't think arduino's serial is configured for inverted format. Can someone confirm this?
Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

(not read the PDF, but building upon liudr's comment)

NewSoftSerial has a flag to send inverted bytes. The hardware Serial of the UNO can't do this AFAIK.

Vikash, download NewsoftSerial and start testing with that

In the meantime, could you try this testsketch to see if inverted code works.
Code:
void setup()
{
  Serial.begin(9600);
               
  Serial.print(1, BYTE);  //Clear Screen
  delay(5);
  Serial.print('A' ^ 0xFF);   // single char inverted.
}

void loop() {}
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

void setup()
{
  Serial.begin(9600);
  delay(500);
  Serial.print(254,BYTE);

  Serial.print(1, BYTE);  //Clear Screen
  delay(5);
  Serial.print('A' ^ 0xFF);   // single char inverted.
}

void loop() {}



i used this code with the delay and (254,BYTE) to differentiate between control code and normal character. i get the output as a triangle shaped dots all over the LCD screen. U can see under 'fig.5 character code chart' 0 under 128. I have attached the file for you

And to liudru my LCD can display inverted format.

* 6_143.pdf (112.51 KB - downloaded 39 times.)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i downloaded newsoftserial from http://arduiniana.org/2011/01/newsoftserial-11-beta/. but i dont know how to include under example or library folder.
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 168
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Beta is different to before - it replaces the core library SoftSerial.  So you need to find the SoftSerial folder in your Arduino folder and remove it, and then put the NewSoftSerial there instead.
Logged

Current Projects: Rodentometer - Hamster Endurance Moni

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6898
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you try more delays right after you send the clear screen because this command may take more than 5ms to run. You only gave it 5ms.

If you forget the clear screen for a moment and just print one character at a time every second, do you see any characters appearing on the screen?

The screen seems to be a design 10 years old so the hardware may be that old too, there is a chance it is broken.
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i used a delay of 10 ms as mentioned in the data sheet. but even tho i am not getting the output. this is the code which i used recently


void setup()
{
Serial1.begin(9600);
delay(500);

// Move cursor one character left

Serial1.print(254, BYTE);

Serial1.print(1, BYTE);
delay(10);
//Serial1.print("Hello");
}

void loop()
{


//Serial1.print(254, BYTE);

//Serial1.print(1, BYTE);
//delay(100);
}
// clear the LCD


i have attached the output for my code and the back view of my LCD screen. U can see the data sheet too alonb with this reply.

in the data sheet it is mentioned as

" Baud Rate?
The Driver Board will accept RS-232 signals at either 2400 Baud (jumper missing) or 9600 Baud
(jumper installed). "

is there anything to be done with this.?


* Untitled1.jpg (308.03 KB, 1000x750 - viewed 5 times.)

* Untitled.jpg (426.89 KB, 1000x750 - viewed 6 times.)
* 6_201.pdf (32.32 KB - downloaded 9 times.)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi to all...

thanks a lot for your help....

my LCD is working fine. I used a SN74LS04N inverter for the LCD serial input and the following code. I used serial1 because i am using Arduino Mega and i use TX1 for output.
void setup()
{
  Serial1.begin(9600);
  delay(500);
  Serial1.print(254,BYTE);

  Serial1.print(1, BYTE);  //Clear Screen
  delay(10);
  Serial1.print("hi");   // single char inverted.
}

void loop() {}


I get the expected output as hi
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6898
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's what I suspect, the inverted logic as written in the document. BTW you can take robtillaart's suggestion to use NewSoftSerial, which can be set to output inverted logic.

I have a question for you: did you buy this display for a PIC?
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

NO i bought this for arduino mega
Logged

Pages: [1]   Go Up
Jump to: