hd 44780 gpio

Using HD44780 on Raspberry Pi – part 5: 40×4 (direct access)

This time we will add support for Char LCD with size 40×4. Such display is a special case, when we look at the internal schema we will see that its in fact two-in-one lcd. It has two lcds, one lcd goes on top and second on bottom.
It’s because one HD 44780 can display maximum 80 chars and this is 40×2. If we want 160 chars we must double this.
This way we have two 40×2 lcds. For our purpose lets call such display a twin-lcd.

Download source

Older parts

(more…)

Advertisements

Using LCD HD44780 on Raspberry Pi – part 3: upgrades and tests

Before we add new drivers lets do some more cleaning, upgrading and add nose tests.

First we will clean driver class and remove manual 4/8 bit function usage.

Next we will add abstraction class to our driver to force required functions implementation.

Finally we will add Nose framework for tests. And add few simple tests.

This time I will attach ziped source code

(more…)

Using LCD HD44780 on Raspberry Pi – part 2: drivers

lcd_20_tutorial_2If we look at our code from part one we will see that more than half functions are used to communicate between Raspi and lcd. In this tutorial we will separate low level function from user functions and create a driver class. Why ? If we connect later our LCD by i2c we will just add new driver and it will work.

All function used to communicate directly with display will be moved to separate driver class, a GPIO driver class. Such basic function are _write and _write4. But in our case it is not so simple, all around a code we have some GPIO.output(self.PINS[‘E’], 1) lines, like in _send(self) function. We will do something about it, but lets start from small things.

Current CharLCD class will be refereed as user driver or user class, and new one as driver or low level driver.

(more…)