2-Bit Interface For Character LCDs

Thread Starter

Joseph Watson

Joined May 27, 2015
7
Like many others, I have used a number of character LCDs. These use an HD44780 LCD controller chip (or equivalent) to run the display itself. The primary mode of operation of these LCDs is their 8-bit mode but hobbyists often choose to use the alternate 4-bit mode to conserve I/O pins on the microcontroller in their project. Even if the LCD module's Read/Write line is grounded, 8-bit mode requires 10 I/O pins whereas 4-bit mode requires only 6 I/O pins.

I have seen circuits that effectively cut the number of required I/O pins further by adding a shift register or some other integrated circuit and I have even done that on one occasion myself.

Most of the time, I have been using these displays in 4-bit mode but recently happened upon an idea that made another big improvement in the number of required I/O pins but without requiring the addition of any semiconductors at all. I call it the 2-Bit Interface For Character LCDs. This allows a character LCD to be operated using only 3 I/O pins.

I wrote up a page about the technique, detailing how it works and how to prepare your own software to reproduce it in your own system, regardless of which microcontroller and which language you are using.

You can find my page here: http://www.angelfire.com/oh3/ebjoew/LCD_2-Bit_Interface.html

I hope this proves as useful to others as it does to me.
 

ErnieM

Joined Apr 24, 2011
8,377
And if you think people don't have enough problems getting the timing down to run the 4-bit interface directly then this circuit is for you.

I've never been a fan of putting delays on digital pins as the pins themselves are very inexpensive when priced as their incremental cost.

The I2C bus expanders seem to do a decent job for this at a cost of 2 I/O lines and a chip.
 

Thread Starter

Joseph Watson

Joined May 27, 2015
7
There is only one point in the whole operation where the timing is important. It requires that you output to the 3 I/O pins, wait 1 microsecond or so, and then clear one of the I/O pins. Interrupts must be prevented during that brief sequence. The rest of it is very loose on timing. Any other time delay expressed may be extended indefinitely without ill effects. That important timing constraint is well identified on that page.
 

shteii01

Joined Feb 19, 2010
4,644
I have used lcd with i2c interface in my senior design project. It used only 2 lines. Of course my uC had i2c hardware and software support (Arduino Due) so the whole thing went pretty easy.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Nice job! Seems like a really clever way of getting the most out of your resources... though I must confess I'm still inclined to go the lazy route with I2C. It's just so easy as long as you don't mind having the extra chip involved.
 
Top