Path: EDN Asia >> Design Ideas >> IC/Board/Systems Design >> MCU drives LCD with just a single wire
IC/Board/Systems Design Share print

MCU drives LCD with just a single wire

25 Apr 2016  | Benabadji Noureddine

Share this page with your friends

The most popular alphanumeric displays in embedded systems are HD44780 LCDs. The only downside is that they use six I/O pins in 4bit nibble mode and as many as 11 pins in 8bit mode. Earlier articles have described many approaches to saving or expanding I/O pins (reference1, 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.


Figure: This circuit interfaces a pin-limited embedded system with an HD44780-compatible display through a one-wire serial link using an asynchronous, simplified RS-232 protocol.


The circuit in the figure 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 optimised 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 1B as a command for the LCD, a maximum of 16B 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 analogue-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.


About the author
Benabadji Noureddine contributed this article.


This article is a Design Idea selected for re-publication by the editors. It was first published on December 3, 2007 in EDN.com.




Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.


Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming


News | Products | Design Features | Regional Roundup | Tech Impact