MSP430G2552 with HD44780 16x2 LCD Panel

Thread Starter

EngineCan

Joined Sep 12, 2021
5
Hey there, this is my first time posting here. I definitely appreciate any and all help.

I've got a TI MSP430G2552 microcontroller that I am using, leftover from a class last semester. I also have a 16x2 LCD with the HD44780 controller/driver. I'm building the library and C files inside of Code Composer 10.4.
Despite my best attempts to get something to display on this LCD, I have been wholly unsuccessful.

I've been attempting to use the library files from this source:
http://nikosapi.org/w/index.php/MSP430_HD44780_Controller_Software

The above link was found from this site, which has several broken links from who knows how long ago:
https://www.instructables.com/C-Library-for-HD44780-LCD-Display-Controller/


Anytime I build the files, I get an error:
Capture.PNG


I have ensured that I my circuit has the LCD in 4-bit mode (versus 8-bit).

Has anyone done this or had any success? I will gladly provide more information as requested, but am stumped right now. I've been fooling around with this silly thing for a good month or so with no success.

Thank you for any and all help!
 

MrChips

Joined Oct 2, 2009
30,806
Here is my suggestion. If you want to learn how to work with MCUs (microcontrollers) don't use any libraries.
Learn how to program your own.

Right now your problem is not programming. Your errors are as a result of using libraries that someone else wrote.
If you write your own code you wouldn't have to depend on someone else's code.

So first step.
Write code to make an LED flash.

If this is of any help to you, you can start here.
 

MrSalts

Joined Apr 2, 2020
2,767
http://www.wizard.org/auction_support/lcd1.pdf
http://www.wizard.org/auction_support/lcd2.pdf

those two will get you started on the finer points of using your microcontroller to talk to the hitachi chip on your display. The LCD2 document is ok, but the original version by the same author is better. I printed it out years ago and used it to teach some kids. I have it somewhere if you can't sort though that version. The version above uses a PIC but you should be able to read through the .asm code ok. If not, ask here.
 

Thread Starter

EngineCan

Joined Sep 12, 2021
5
Here is my suggestion. If you want to learn how to work with MCUs (microcontrollers) don't use any libraries.
Learn how to program your own.

Right now your problem is not programming. Your errors are as a result of using libraries that someone else wrote.
If you write your own code you wouldn't have to depend on someone else's code.

So first step.
Write code to make an LED flash.

If this is of any help to you, you can start here.
Hey Mr.Chips, thanks for the reply.
I've actually taken a class using this micro controller. We programmed not only the onboard LED's to flash, but also a series of various colors using the RGB LED. We went further and programmed external buttons, as well as touched on enabling the interrupt service in order to put the processor to sleep in between presses.

I was trying to use a library for this LCD, because writing my own driver (from what I can tell) would be an enormous undertaking. I wanted to get the LCD running and integrate a couple of buttons along with it for a (very) simple physical UI.
However, you may be right. I will look into writing my own library file. (Yikes!) lol
Thanks again.
 

Thread Starter

EngineCan

Joined Sep 12, 2021
5
http://www.wizard.org/auction_support/lcd1.pdf
http://www.wizard.org/auction_support/lcd2.pdf

those two will get you started on the finer points of using your microcontroller to talk to the hitachi chip on your display. The LCD2 document is ok, but the original version by the same author is better. I printed it out years ago and used it to teach some kids. I have it somewhere if you can't sort though that version. The version above uses a PIC but you should be able to read through the .asm code ok. If not, ask here.
I'll certainly take a look! Thank you. :)
 

MrSalts

Joined Apr 2, 2020
2,767
Hey Mr.Chips, thanks for the reply.
I've actually taken a class using this micro controller. We programmed not only the onboard LED's to flash, but also a series of various colors using the RGB LED. We went further and programmed external buttons, as well as touched on enabling the interrupt service in order to put the processor to sleep in between presses.

I was trying to use a library for this LCD, because writing my own driver (from what I can tell) would be an enormous undertaking. I wanted to get the LCD running and integrate a couple of buttons along with it for a (very) simple physical UI.
The Hitachi driver takes care of most of the work including ascii to font so you don't have to draw the pixels. The code is surprisingly short on the LCD2.pdf link. The LCD1.pdf shows you how to get something to display with just dip switches.

also, don't forget to use a potentiometer to set the bias voltage (which sets the contrast. Without, you may see all black pixels or all clear pixels (like it's off).
 

Thread Starter

EngineCan

Joined Sep 12, 2021
5
The Hitachi driver takes care of most of the work including ascii to font so you don't have to draw the pixels. The code is surprisingly short on the LCD2.pdf link. The LCD1.pdf shows you how to get something to display with just dip switches.

also, don't forget to use a potentiometer to set the bias voltage (which sets the contrast. Without, you may see all black pixels or all clear pixels (like it's off).
That's a relief. From what I had gathered so far, writing a library file for it was going to be scary. I'm a novice when it comes to the MCUs, but a bit more experienced with programming.
I've downloaded both of those PDFs and will go through them this weekend or next.
Right now, I'm in uni, so time isn't something that I've got an ample amount of. hah But I want to get this working!
Thanks again for your help. I'll try to follow up once I've made some progress.
 

MrChips

Joined Oct 2, 2009
30,806
If you have already been introduced to programming an MSP430 Launchpad then writing your own library for LCD is a walk in the park. If you can make an LED flash then you can program the LCD.

What you need to do is:
1) Set output to R/W
2) Set output to RS
3) Set data bits
4) Pulse E high and then low.

What is critical is the sequence of events. This is where you want to arm yourself with the datasheet of the HD44780 controller.

For starters, what you need are two low level functions:
1) Send a byte to the Instruction Register.
2) Send a byte to the Data Register.

From here, your focus is will be:
1) Initialize the LCD controller.
2) Display a single character on the screen.
 

MrSalts

Joined Apr 2, 2020
2,767
And set the bias voltage and make sure the timing is reasonable - the are initialization steps that need more than one instruction clock cycle - details on the two PDFs I sent.
 

MrChips

Joined Oct 2, 2009
30,806
TS hasn't gotten to that part yet. They are still struggling with compiler errors because of undefined references in somebody's library. That wouldn't happen when you write your own code. That is what needs to be remedied at this stage.
 

Thread Starter

EngineCan

Joined Sep 12, 2021
5
If you have already been introduced to programming an MSP430 Launchpad then writing your own library for LCD is a walk in the park. If you can make an LED flash then you can program the LCD.

What you need to do is:
1) Set output to R/W
2) Set output to RS
3) Set data bits
4) Pulse E high and then low.

What is critical is the sequence of events. This is where you want to arm yourself with the datasheet of the HD44780 controller.

For starters, what you need are two low level functions:
1) Send a byte to the Instruction Register.
2) Send a byte to the Data Register.

From here, your focus is will be:
1) Initialize the LCD controller.
2) Display a single character on the screen.
This is awesome, thank you! I've got a lot of homework to focus on this weekend, but will get back to you once I've made some progress.
 
Top