Pages: [1] 2   Go Down
Author Topic: Parallel LCD display  (Read 2621 times)
0 Members and 1 Guest are viewing this topic.
Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've had this display for a while and decided to start using it on the Arduino and successfully using a Parallax Serial LCD. I noticed that the first LCD board was almost identical to the one used by the Parallax (sans the serial daughter board) but have had numerous problems getting it to work. Some sample sketches worked and some didn't. After comparing sketches I noticed that the ones that did work had seven parameters in the
Code:
LiquidCrystal lcd(rs,rw,en,d7,d6,d5,d4);
and the ones that didn't work only had six, the rw line being omitted - as per the LiquidCrystal library tutorial. With the sketches that didn't work; I added the 7th RW parameter and the display starts working. Has anyone else had this happen or is this a very slight incompatibility between display units? BTW, the label on the display reads:
VHX1620 BHR 01-21W
My thinking VHX=maker, 162=display size, 0=? BHR=? 01-21W=date code(21st week of 2001)
Of course, searching for VHX1620 didn't yield too much info. Like I said; I only got it working after I noticed similarities.

FWIW: because there's no daughter board in the way, I was able to trace the header pin lines to the group of resistors and capacitors on one end and was able to solder the 10K variable to two of the open pads and solder the wiper to pin 3 of the header and I also soldered the RW line to another ground pad. So now I had a 6-pin connector for data and a 2-pin connector for power.
Logged

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

When you are not using RW, are you grounding this pin? You should.
Logged


Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, this RW is also soldered to ground. And when using the seven parameter, I've been keying in NULL for it's place.
Logged

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

Post a hi-res picture and the code that doesn't work. I'll take a look.
Logged


Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As I have a simple fix; I'm not all that worried about it now. But the one of the sketches I tried was from here http://arduino.cc/en/Tutorial/LiquidCrystal. The one that started working for me was:
Code:
/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD and shows the time.
 
  The circuit:
 * LCD- 1 Gnd
 * LCD- 2 Vcc
 * LCD- 3 Wiper of 10K varible resistor
 * LCD- 4 RS pin to digital pin 12
 * LCD- 5 R/W pin to ground
 * LCD- 6 Enable pin to digital pin 11
 * LCD-11 D4 pin to digital pin 5
 * LCD-12 D5 pin to digital pin 4
 * LCD-13 D6 pin to digital pin 3
 * LCD-14 D7 pin to digital pin 2
 
 Library originally added 18 Apr 2008 by David A. Mellis
 library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009  by Tom Igoe
 modified 22 Nov 2010      by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//                RS  R/W   EN D4 D5 D6  D7
//LiquidCrystal lcd(11, NULL, 12, 7, 8, 9, 10);
LiquidCrystal lcd(3, NULL, 4,A0,A1,A2,A3);

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);
}
pin numbers were changed so I could use the analog pins but I started with the initial setup pin numbers and then the second and then the third. All three work here - with the 7 parameters.
I haven't been able to post photos of anything yet. I'm sure I'll learn soon enough.
Logged

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

NULL is 0 so you are using pin 0 as RW. You might have trouble with grounding the RW pin.
Logged


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

Quote
As I have a simple fix; I'm not all that worried about it now
Well maybe you should be worried.

Quote
NULL is 0 so you are using pin 0 as RW. You might have trouble with grounding the RW pin.
I think you mean "You might have trouble with grounding pin 0".  Let me try to clarify this.

Here is the problem with your 'simple fix'.  By using seven parameters you are telling the library that you want it to drive a certain pin low.  By using a 0 (NULL) for the second of those parameters you are telling the library that it is digital pin 0 that you want driven low.  You aren't using digital pin 0 right now so you don't notice any problems, but if you were to try to use it you could run into unexpected errors.


Don



Logged

Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, I looked through the LiquidCrystal.cpp listing and saw that if the RW line was tied to ground, then to use 255 as the pin number. So I'm changing my programs to use 255 since I intend on using D0 and D1 for another serial device.
Logged

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

ok, I looked through the LiquidCrystal.cpp listing and saw that if the RW line was tied to ground, then to use 255 as the pin number. So I'm changing my programs to use 255 since I intend on using D0 and D1 for another serial device.

Why go to that trouble when you can just use six parameters (like everyone else) and be done with it?

Don
Logged

Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

as per the initial post, I could never get the 6 parameters to work. That's why I decided to use 7 parameters.
Logged

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

as per the initial post, I could never get the 6 parameters to work. That's why I decided to use 7 parameters.

Wouldn't it be more prudent to find out why you couldn't get the six parameter technique to work?  No one else seems to have reported any problem.

Don
Logged

Georgia, US
Offline Offline
Jr. Member
**
Karma: 2
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

eventually I will be cleaning up my code. I learned to program in Basic over 30 years ago and back in my college days, decided I didn't think 'C' was going to be worth while. (boy, was I wrong about that smiley-grin)
But working my program a bit at a time and getting most of the functionality working first is my first goal. then clean up. most of my teachers hated/tried to discourage my sitting at the keyboard and writing my programs off the top of my head versus coding on paper first.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2762
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

eventually I will be cleaning up my code. I learned to program in Basic over 30 years ago and back in my college days, decided I didn't think 'C' was going to be worth while. (boy, was I wrong about that smiley-grin)
But working my program a bit at a time and getting most of the functionality working first is my first goal. then clean up. most of my teachers hated/tried to discourage my sitting at the keyboard and writing my programs off the top of my head versus coding on paper first.


You need to really re-think your strategy/methodology.
When playing with Microcontrollers, really any type of hardware, it isn't like playing with software.
You can't always get away with using the trial and error method to stumble along until
something "works" or appears to work.
With hardware if you hook things up wrong, things can be damaged or burn up.
Complicating things further is that the hardware is driven by software in this type of environment.
So that means that software can actually damage the hardware.

I highly recommend that you slow down a bit and take a much more methodical approach.

--- bill
Logged

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

Quote
I learned to program in Basic over 30 years ago ...

That's about the right time frame ...
"
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."  (Edsger W.Dijkstra, 18 June 1975)

Don
Logged

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

Quote
boy, was I wrong about that

You are not wrong at all: we all use products from a multi-billion company founded on BASIC.
Logged

Pages: [1] 2   Go Up
Jump to: