Pages: [1]   Go Down
Author Topic: 16x2 lcd  (Read 1037 times)
0 Members and 1 Guest are viewing this topic.
ahmedabad
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i m trying to interface LCD with arduino leonardo..
but lcd doesn't write anything on the screen.
i checked my connection.they are properly done.
i upload this program...
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}
this program shows nothing on lcd.
i checked voltage on each pin.
i found that enable pin which is pin no. 11 of arduino has always 0V.
is this causes problem to write data on lcd?
and i m using 1K variable instead of 10K..is this a problem?
Logged

Central MN, USA
Online Online
Tesla Member
***
Karma: 74
Posts: 7230
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Most spec sheets I read online about these displays require 2K to 20K potentiometers but 1K might be fine if you can see black boxes. Did you see black boxes on the display if you turn the potentiometer?
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4382
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i checked my connection.they are properly done.
Where have I seen that before???

Quote
this program shows nothing on lcd.
What do you mean by 'nothing'?

Quote
i checked voltage on each pin.
i found that enable pin which is pin no. 11 of arduino has always 0V.
is this causes problem to write data on lcd?
A voltmeter will tell you nothing here, you need a logic analyzer or an oscilloscope to get any meaningful information.

Quote
and i m using 1K variable instead of 10K..is this a problem?
This will work fine as far as the LCD is concerned.  You are, however, drawing 10 times the current from your power supply which could cause a problem.  Your voltmeter will give meaningful information here.

Don

« Last Edit: November 27, 2012, 01:42:42 pm by floresta » Logged

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

i can see only this on lcd....(image is below)


* 2012-11-28 12.04.51.jpg (1084.09 KB, 2048x1536 - viewed 36 times.)
Logged

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

lcd writes data when enable pin receives high to low pulse.....
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
in this syntax 11 no. pin is connected to enable pin of lcd...
but i noticed this pin remains low..means at 0V...
is this a problem due to which lcd displays no letters..?
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i can see only this on lcd....(image is below)

That means the device is getting powered up, has the right contrast, but not correctly initialized.
Logged

Central MN, USA
Online Online
Tesla Member
***
Karma: 74
Posts: 7230
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The LCD looks decent so now where is the other side of the connection?
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4382
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
lcd writes data when enable pin receives high to low pulse.....
That is not correct.   It is the microcontroller that is writing the data, the LCD is receiving data.  This does indeed occur on the falling edge of the enable pulse but only if you have observed all of the other timing requirements.

Quote
but i noticed this pin remains low..means at 0V...
How did you determine this?

You appear to have the power and contrast set up correctly.  To figure out why your LCD is not being properly initialized we will need a clear (in focus) photograph showing both ends of all of the wires that connect between your Arduino and your LCD module.


Don
Logged

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

thank u so much...
it works fine now...
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well done Don, the thought of a photograph cured it   :-)
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Pages: [1]   Go Up
Jump to: