Tiny Terminal Using MSP430 and HD44780 Display

We have dozens of these HD44780-based LCD displays — now we just gotta make some use of them.  Here’s an experiment using an MSP430 to create a display that can be written to using serial data.  The displays actually have chips in them that can send the data as a differential signal (a la RS422), so it should be possible to send the serial over great distances if needed. The displays are also waterproof and have a six key membrane keyboard built in.  With the addition of a $1 MSP430, the setup turns out to be a pretty sweet building block …

A preliminary version of the HD44780 library for MSP430s is available here.

13 thoughts on “Tiny Terminal Using MSP430 and HD44780 Display

  1. nice! where did you find the water resistant lcds? i have been pondering how to handle waterproofing a 16×2 character lcd for months.

  2. I work at a Siemems division that does process control, amd these displays are used in certain flow and pressure transmitters. Since they are often installrd in rugged conditions, they are well sealed.

    Whenever an instrument is found to be defective, they just toss the whole thing. Since the displays almost never fail, this reults in a pretty steady trickle of displays.

    We would be happy to let some go cheap (or even free to a good cause) .. we have far more than we can use.

    I will mention that the layout of thr screen is a little odd. Logically, it is a two line display, but physically it’s a four line display (requires a diagram to explain adequately)

  3. I have tried your HD44780 library with a MSP430 Launchpad and a 16×1 LCD with mspgcc and it works okay.

    Please also post the code you used for the Tiny Terminal.

    A MSP430x2xxx is way cheaper than the “Serial Enabled LCD Backpack” from SparkFun 🙂

  4. Thanks for giving it a whirl, and special thanks for taking the time to provide feedback.

    I’ll pull together a clean demo of the terminal and post the project as soon as i can. Basically, i found code that implemented a bit-banging 9600 baud interface over the COM port presented by the LaunchPad (the other USB-FETs also host a similar COM port).

    Thanks again,

  5. Hi, What compiler was used to test the library and code? I tried on mspgcc4 and it seems that it will require porting.

  6. Hi Chetan,

    I used CodeComposer 4.something-or-other. The main differences between CC4 and a bare mspgcc development system are likely to be the device-specific headers and libraries that get automatically installed with CC4.

    As far as the “main() in a header” thing is concerned .. the project uses an early version of a library that I plan to release soon called “TIWrap”. The TIWrap library is intended to make MSP430 projects look like code written in the popular Arduino “Wiring” language. This makes it easier for Arduino users to use MSP430 and it also makes it easy to port the various open-source Arduino libraries to MSP. Wiring programs always have two routines .. an init() routine and an endless loop() routine, so the TIWrap headers implement those two routine by default. You can inhibit this by making a #defiNE NO_ARDUINO_LOOP declaration before you pull in the header.

  7. Thanks Pez.

    I know some about Arduino but nothing about wiring. I thought that it was a ANSI C and therefore was confused.

    I’ll try your suggestion of #DEFINE


  8. Hi Chetan,

    The project is ANSI C — the TiWrap headers just define functions that impersonate the various intrinsic functions of the Wiring language (which is a simplified “C++-like” dialect). It seems like most DIY-ers tend to get started with Arduino, so having a library that can mimic the Arduino (sort of) is one way to help these folks branch out a little.

    Most of the Arduino libraries are open source, and they tend to use the Wiring intrinsic functions quite a bit, so having similar functions for the MSP makes it relatively easy to port useful functions from Arduino to MSP.

    The latest version of the TIWrap library is available here: http://bigvulcandeal.com/msp430/sample_code/TiWrap_demos.zip
    It has some demos for interfacing with HD44780, MAX7221, some timing function demos etc. I plan to add charlie-plexing libraries and the like shortly.

    Your post has given me the idea to experiment with getting this stuff working using a pure mspgcc setup under Ubuntu. My guess is that this will actually be a little bit challenging due to headers, libraries etc. that are bundled in with CC4, but it sure would be nice.

    mike hogan

  9. Hi Mike,

    Yes, I do use Ubuntu on a VM with mspgcc4. Few years back, I had issues with eZ430-F2013 running under any XP or Linux VM. The USB did not pass-through completely.

    With Launchpad, they changed the device type to be HID so it is easier.

    I took a few examples that were written for CCS (I think those are TI examples) and they work like a charm with mspgcc4. I’ll try some more examples and post results.


  10. Hah! Very familiar with the quirky behavior of the EZMSP under VMs. I taught a class here at Hive76 and it was a major distraction.

    Getting it to compile may be as simple as setting the right header for the device. The example uses MSP430G2231, and CC4 automatically decides which header to use.

    If you get a good result, I am interested in learning about it. Hope this doesn’t chew up more of your time than it saves …

  11. chetan@linux-MSP:~/proj/gcc-test$ make
    msp430-gcc -Os -Wall -g -mmcu=msp430x2012 -c main.c
    main.c:23: warning: return type of ‘main’ is not ‘int’
    msp430-gcc -Os -Wall -g -mmcu=msp430x2012 -o main.elf main.o

    lrwxrwxrwx 1 chetan chetan 15 2011-03-04 18:29 main.c -> msp430x20x3_1.c
    -rwxr-xr-x 1 chetan chetan 8927 2011-03-04 18:29 main.elf
    -rw-r–r– 1 chetan chetan 9032 2011-03-04 18:29 main.o
    -rw-r–r– 1 chetan chetan 183 2010-11-08 11:10 Makefile
    -rw-r–r– 1 chetan chetan 1164 2008-05-01 16:17 msp430x20x3_1.c

    I just compiled msp430x20x3_1.c that came from TI no changes made to the file, just linked it to main.c and added my default Makefile.

    // MSP430F20xx Demo – Software Toggle P1.0
    // Description; Toggle P1.0 by xor’ing P1.0 inside of a software loop.
    // ACLK = n/a, MCLK = SMCLK = default DCO
    // MSP430F20xx
    // —————–
    // /|| XIN|-
    // | | |
    // –|RST XOUT|-
    // | |
    // | P1.0|–>LED
    // M.Buccini / L. Westlund
    // Texas Instruments, Inc
    // October 2005
    // Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.40A


    void main(void)
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
    P1DIR |= 0x01; // Set P1.0 to output direction

    for (;;)
    volatile unsigned int i;

    P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR

    i = 50000; // Delay
    do (i–);
    while (i != 0);

Leave a Reply

Your email address will not be published. Required fields are marked *