Pages: [1]   Go Down
Author Topic: Help needed with 16x2 LCD Displaytech 162A  (Read 1320 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I try to get a 16x2 Displaytech 162A LCD running with my Arduino Uno using the LiquidCrystal library
using Arduino 1.0.3.
I googled around, but am not sure about the wiring.
When I turn my Arduino on, the LCD backlight is on (green)and on one line i see dark blocks, the second line is empty.
Wiring information is included in the code.

Am I missing something important?

Code:
// LCD Pin -> Arduino Pin
// 1 -> GND
// 2 -> 5V
// 3 -> GND
// 4 -> 12
// 5 -> 11
// 6 -> 10
// 11 -> 5
// 12 -> 4
// 13 -> 3
// 14 -> 2
// 15 -> 5V
// 16 -> GND

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
}
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6613
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. Have you connected a contrast potentiometer?

2. Try with an empty loop() function, concentrate on getting hello world to display. Alternatively, add a delay(1000) call in loop so that you are not constantly rewriting new data to the lcd.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

1. I just added one (on Pin 14) and can now vary the contrast of the black blocks, but no hello world is showing.
2. Removed it, just using the setup() now, but no changes.
Logged

Hamburg, Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi durpex,
I don't have the spec for the LCD here but something does look odd. You have pin 6 on the LCD connected to pin 10 on the arduino, but no where in the code are doing anything with pin 10.
(?)
- Totoro
Logged

Hamburg, Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again,
Yeah, it looks like you should be calling the lcd constructor with LCD pins 4,6,11,12,13,14 or for your assignments arduino pins 12,10,5,4,3,2. And I think the LCD pin 5 needs to be tied low.
-Totoro
Logged

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

Quote
Yeah, it looks like you should be calling the lcd constructor with LCD pins 4,6,11,12,13,14 or for your assignments arduino pins 12,10,5,4,3,2. And I think the LCD pin 5 needs to be tied low.
This is close but not exactly correct.

You have seven connections between your Arduino I/O pins and the LCD module so you need seven entries in the constructor.

// 4 -> 12
// 5 -> 11
// 6 -> 10
// 11 -> 5
// 12 -> 4
// 13 -> 3
// 14 -> 2

Therefore you need LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

OR

Connect pin 5 of the LCD to GND and use LiquidCrystal lcd(12, 10, 5, 4, 3, 2);


Don

Logged

Pages: [1]   Go Up
Jump to: