Zibb

Design Idea

Microcontroller drives LCD with just one wire

A Microchip PIC10F family microcontroller sparks an HD44780 LCD using a single I/O pin.

Noureddine Benabadji, University of Sciences and Technology, Oran, Algeria; Edited by Charles H Small and Fran Granville -- EDN, 12/3/2007

HD44780 LCDs are the most popular alphanumeric displays in embedded systems. The only downside is that they use six I/O pins in 4-bit nibble mode and as many as 11 pins in 8-bit mode. Earlier Design Ideas have described many approaches to saving or expanding I/O pins (reference 1, reference 2, and reference 3). In driving an HD44780-compatible LCD, it would be better to use a baseline microcontroller instead of logic chips, because the microcontroller is lower cost, uses less board space, and has programming features. Microchip has introduced the smallest PIC10F microcontroller family, which comes in a six-pin SOT-23 package.

The circuit in Figure 1 proves useful for any pin-limited embedded system that must interface with an HD44780-compatible display through a one-wire serial link using an asynchronous, simplified RS‑232 protocol at 9600 baud. It uses a PIC10F202, but any member of the PIC10F family is suitable, because the highly optimized source code in Listing 1 allows the program code to take fewer than 256 words. It is useless to try higher baud rates than 9600, because the PIC10F202 uses an RC internal oscillator with 1%-frequency tolerance, and the LCD requires a delay as long as 1.6 msec for some instructions, such as “clear display.”

Listing 1 is the fully commented assembler source code for the LCD232 module; the main routine consists of the display of a 2‑sec-delay “splash screen,” and then it enters an endless loop to wait for 1 byte as a command for the LCD, a maximum of 16 bytes as data for the LCD, and an ASCII zero. For test purposes with an external PIC microcontroller embedded system, Listing 2 is a simple assembler source code, which sends another splash screen.


References
  1. Raynus, Abel, “Squeeze extra outputs from a pin-limited microcontroller,” EDN, Aug 4, 2005, pg 96.
  2. “Microcontroller provides low-cost analog-to-digital conversion, drives seven-segment displays,” EDN, May 10, 2007, pg 80.
  3. Niven, Rex, “RC lowpass filter expands microcomputer’s output port,” EDN, June 21, 2007, pg 74.


Reed Business Information Resource Center

Featured Company


Related Resources

ADVERTISEMENT

ADVERTISEMENT

Related Content

 

By This Author


ADVERTISEMENT

Knowledge Center





Technology Quick Links

EDN Marketplace


©1997-2009 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites