Jump to content

Hello World using CogLCD

Recommended Posts

Hello everybody


I have been writing some programs for a Stellaris Launchpad using Energia. 

The last one I tried was writing a LCD (with HD44780 controller). For some reason it does not work...


However reviewing the examples I found the "Hello World" that  uses the CogLCD library. That is supposed to be the thing I am writing and seems fine so far but :


  • Where are the pin arrangements? The code gives a homepage for the Arduino equivalent but as you are going to see later this is not useful because the programs and libraries are different


  • The LCD library in the Arduino page gives the correct functions to control that HD44780 LCD, but the Energia CogLCD uses SPI!. As far as I know the HD44780 uses 4-bit or 8-bit parallel interface to pass data and not SPI. Ergo the library is useless for that kind of LCD.


Can someone comment me on what is going on here??


Thanks a lot for any comment or advice

Link to post
Share on other sites

A search on 43oh turned up this:  http://forum.43oh.com/topic/6757-very-basic-hd44780-driver-for-stellaris-launchpad/


PS:  It is possible to buy backpacks for LCDs with HD44780 controllers with SPI or I2C - for example:  https://www.adafruit.com/products/292

and of course they can be bought with a backpack attached.


Link to post
Share on other sites

@@KR1 the Library you are looking for is LiquidCrystal. This is a port of the original Arduino Library for the HD44780 based LCD's. Right now it is only supported for MSP430. The Library compiles for the other platforms (TivaC, CC3200, etc) but I have not had the time to test them and hence they are not there for those boards. You can try however to copy the library from <energia installation>/hardware/msp430/libraries to the <energia installation>/hardware/xyz/libraries.


I have files an issue for it on github so that we can keep track of it: https://github.com/energia/Energia/issues/803

Link to post
Share on other sites



The suggestion from @@energia worked for me.



I used the same pins that are in the example, remembering that +5V is labelled VBUS and is pin 21 on the Tiva LaunchPad.

 The circuit:
 LCD pin              Connect to
 01 - GND             GND, pot
 02 - VCC             +5V (VBUS), pot
 03 - Contrast        Pot wiper
 04 - RS              Pin8 
 05 - R/W             GND
 06 - EN              Pin9 
 07 - DB0             GND
 08 - DB1             GND
 09 - DB2             GND
 10 - DB3             GND
 11 - DB4             Pin10 
 12 - DB5             Pin11 
 13 - DB6             Pin12 
 14 - DB7             Pin13 
 15 - BL+             +5V (VBUS)
 16 - BL-             GND

Also, instantiate with the pin numbers

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

To use the LiquidCrystal library copy it from the MSP430 libraries over to the lm4f libraries.  On my Windows machine with Energia v17 that would be C:\energia-0101E0017\hardware\msp430\libraries\LiquidCrystal to C:\energia-0101E0017\hardware\lm4f\libraries\LiquidCrystal


EDIT:  A better title for this is "Using LCDs with the HD44780 controller on Tiva C Series Launchpads"


Another EDIT: 

I'm using Energia v17, LaunchPad is EK-TM4C123GXL REV A

Also works with Energia v17 and the MSP432-EXP432R401R Rev1.0

Link to post
Share on other sites

Happy to hear you got it working! Thanks for reporting back!


Be very carful with the 5v supply. The TivaC LaunchPad's I/O's are not 5 Volt tolerant. Although it is OK to write to the display since LaunchPad will drive the lines with 3.3 Volt which in most cases works, reading from the display exposes the LaunchPad's I/O's to 5 Volt.

As far as I can tell the LiquidCrystal library does not attempt to read from the display and if everything is alright, the I/O's should never be exposed to 5v.



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.

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...