Path: EDN Asia >> Design Ideas >> Computing/Peripherals >> One wire delivers power, data to LCD module
Computing/Peripherals Share print

One wire delivers power, data to LCD module

06 Feb 2014  | Noureddine Benabadji

Share this page with your friends

Embedded systems typically use HD44780-type LCD displays as it is considered the most popular alphanumeric display controller. The interface comprises at least 14 pins: eight for data, three for control (EN, WR, RS), two for power supply (Vdd, Vss), and one for contrast (Vre). Configured in 8bit mode, it requires at least 10 I/O lines (D0..D7, EN, RS). Configured in 4bit mode, it requires at least six I/O lines (D4..D7, EN, RS). This last case seems usable when using an 8-pin PICmicro. However, 8-pin PICmicros have one pin as an input-only pin.

Many solutions for expanding I/O pins have been described in EDN Design Ideas (references 1 to 3). In a pin-limited external embedded system, if an additional LCD display becomes necessary, instead of changing the microcontroller with more I/O lines, it is often better (in terms of cost, and to make development easier and faster) to use this LCD module with a dedicated 8-pin PICmicro and consider it as an intelligent display.

The following design will be useful for any external pin-limited embedded system which needs to be interfaced to an HD44780 compatible display. Communication is via a one-wire serial link, using a simplified asynchronous protocol (8N1 at 2400bit/s). It uses a very cheap 8bit microcontroller, the PIC12F508, but any other member of the baseline PIC12F family is suitable; the program code takes less than 256 words.

The serial link is used as a command/data line (for GP3 pin) and power line (for Vdd pin, through D1 and C1). The filter R2-C2 splits the GP5 pin to two I/O lines. If GP5 outputs a pulse greater than the time constant R2*C2 = 56µs, then input RS receives a high level, and data is written into the HD44780 display at the falling edge of the GP5 pulse.


Figure: A low-cost one wire driven LCD module for external pin-limited system.


Notice that the contrast control (LCD pin 3), instead of using a typical 10K potentiometer, uses an LM334, which ensures a constant current of 200µA to ground (so the contrast does not need to be adjusted as the power supply voltage decreases – if battery powered). In addition, this circuit results in a power saving of over 25% (reference 4).

F508LCD.ASM is the fully commented assembler source code (including LCD2x16c.INC). The main routine consists of displaying a 2s "splash screen", then enters an endless loop to wait for LCD commands, each followed by a maximum of 16B of LCD data, terminated by an ASCII "0". For test purposes with an external pin-limited PICmicro, F202TX.ASM gives simple assembler source code (PIC10F202) which consists of sending another "splash screen" as a message test.


References
1. Squeeze extra outputs from a pin-limited microcontroller. EDN.com. August 4, 2005.
2. Microcontroller provides low-cost analog to digital conversion, drives seven-segment displays. EDN.com. May 10, 2007.
3. RC lowpass filter expands microcomputer's output port. EDN.com. June 21, 2007.
4. Contrast control for LCDs (Elektor Electronics | July-August 2006, Vol.32, N°356).


About the author
Noureddine Benabadji contributed this article.


To download the PDF version of this article, click here.




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