Jump to content
43oh

[SOLVED] Hitachi character LCD not working with the "Hello World" Energia Sketch


Recommended Posts

Hi Guys, 

 

Sorry to bother you but I have hit a fundamental problem which I cannot get any further with unless someone else takes a look. 

 

I have an MSP430 Launchpad EXP430G2 board with the '553 processor installed in the DIL socket. No clock crystal installed. I have a working RT162-7 display, data sheet here := 

 

http://www.ladyada.net/media/lcd/RT162.pdf

 

powered by a separate 5 volt supply. The contrast pot meter works and I can adjust the contrast. I can see the little oblong boxes where the characters display. I know this works because I pulled it from my Arduino system,

 

 

I loaded up the sketch, which is in the examples folder,  below :-

 

/*
  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 pin              Connect to
 ---------------------------------
 01 - GND             GND, pot
 02 - VCC             +5V, pot
 03 - Contrast        Pot wiper
 04 - RS              Pin8 (P2.0)
 05 - R/W             GND
 06 - EN              Pin9 (P2.1)
 07 - DB0             GND
 08 - DB1             GND
 09 - DB2             GND
 10 - DB3             GND
 11 - DB4             Pin10 (P2.2)
 12 - DB5             Pin11 (P2.3)
 13 - DB6             Pin12 (P2.4)
 14 - DB7             Pin13 (P2.5)
 15 - BL+             +5V
 16 - BL-             GND
 =================================
 
 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.
 
 */
 
// include the library code:
#include <LiquidCrystal.h>
 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(P2_0, P2_1, P2_2, P2_3, P2_4, P2_5);
 
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);
}
 
And I have triple checked the wiring. The code compiles cleanly and uploads to the board. However, unlike the Arduino which is running the sketch with the same name from it's programming environment, I see nothing displayed. I am aware that the display is a 5 volt part but I believe that it should work with the Launchpad as according to the data sheet input high on the data lines can be 2.2 volts plus. I gave not tried level convertors yet...
 
I even put a new processor in the board but still nothing. 
 
Does anyone have a clue what I have done wrong.? 
 
TIA Steve
Link to post
Share on other sites

The startup timing on these LCDs is very sensitive.  The ones I have seem to be particularly slow (through still in spec) and the timing constants in many libraries cause it to fail like this.  Drove me nuts when I was trying to get one working for the first time.

 

I don't know anything about the timing in the Energia libs, but you might want to get confirmation on that.

Link to post
Share on other sites

Have you tried forcing a reset of the processor after powerup? I have not used this driver (I don't think, at least), but several displays I have used take a good second after powerup to initialize. I typically put a 1s delay before trying com with the display.

Other things to look at:

 

Common ground between LP and LCD (I know, sounds silly, but we all miss it once in a while)

fixed tie pins (R/W and DB0-DB3) grounded, not floating

Try connecting it on port one. ( Move the connections and change the pin designations in the code)

Use an oscilloscope to watch the pins and confirm timings, in particular RS and ENABLE

Watch the pins with the display disconnected

Not knowing the defaults on energia, I would double check that the LCD init properly sets the output pins up properly.

 

These things can be really annoying to track down, and smetimes mind numbingly simple when you find it.....

Link to post
Share on other sites

You say you have a separate 5v supply for the LCD, have you linked the ground between the Launchpad and the LCD?

I've used this library on quite a few variants of LCD and the only time I've had an issue is when I've missed something with my wiring, eg get EN & RS swapped or forget to link the ground.

 

 

Sent from my iPad using Tapatalk

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...