This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interfacing MSP430G2553 with a 16x2 LCD Display in 4 Bit mode - Trouble Displaying Characters

Good evening, I've been working on interfacing a MSP430 with a Lumex LCD display in 4bit mode.  I have what I believe to be a set of working functions based off of what I have read on this and other forums however it does not display characters.  

Display: 

http://www.lumex.com/specs/LCM-S01602DSF%20A.pdf

Main (simple at the moment for testing): 

http://pastebin.com/7856ct6L

 

LCD header file: 

http://pastebin.com/jiKF08z2

For reference I am working with the IAR embedded workbench.  Any feedback would be much appreciated.  I believed that I might need to add in a delay between the enable toggling during the init() function and also within the sendbyte() function (between nibbles) however that did not help my problem. 

Regards, 

Alex

  • Having the waitstates listed in the datasheet between the instructions is very important. Look at the given delays at startup:

    And you should also have a look at the required delays for the different signals. Take a scope and connect it to your control lines. There needs to be a minimum enable high time for example. Or the time between providing the data and toggling the enable pin.

    Dennis

  • Thanks for the information.  Are those delays a minimum? For example if I used a delay of 5ms between each (slightly longer than the longest time) will that be acceptable? Or does it expect the information at those times exactly.  

    I implemented the delays using the __delay_cycles() function using the clock cycle as a reference for the time that I wanted to wait between enables.  

    -Alex

  • Waiting a little bit longer is no problem.

    Dennis
  • Perfect, solved the problem. With some more refinement the code works great now, thanks for the help.

    Also a semi facepalm moment when I realized I hadn't connected the msp430 dev board's ground to the ground I was using for the lcd. When it was logic 1 being output from the board it was only seeing 1.7 volts on the pin.

    -Alex
  • *** happens ;-)

**Attention** This is a public forum