August 1, 2013

Raspberry pi : A LCD display hardware and software example

Following the previous article about the linux kernel module’s compilation, this post will expose a concrete example of hardware wiring to the Pi GPIOs , and also cover the software aspect, with the implementation of a kernel module who drives the hardware.

The basic idea, and schematic of the hardware, is here:

The Pi GPIO ports, P0 and P5 ( rev2 , raspi version) are visible.
Some GPIO outputs/inputs pins are connected to a 74hc574 latch , wich, in turn, is connected to the LCD display ( industry standard, HD44780 based display).

It’s not obvious, why there is a 74hc574 between the Pi and the LCD display. but, in fact, this ‘574 Latch is freeing 6 pins of the GPIO when the LCD does not have to be adressed. The only pin permanently occupied is the latch clock pin, wich latches the datas to THIS latch (adressing-like, on a microproc. bus). a little bit thinking will let you imagine that the latch enables a BUS-like architecture (more on this later).

The uggly hardware proto board, as usual

The 4x20 LCD display used for my proto

Well the second thing one can notice, is that the LCD display is used in 4-bit mode. nothing new here. 4 bit mode data bus is ‘GPIO-pin-efficient’ solution.
The third thing is that 2 bits of the latch remains unused ( free for other ouputs, your taste… )

I know there’s plenty of LCD connected to raspberry pi everywhere on the internet.latched LCD’s ? there must be less . latched LCD’s with complete kernel module in C code ? there should be lesser again.

A test display text

a capture showing the console in linux : INSMOD of the module, then dump of the kernel messages queue, then echo the test TEXT to /dev/mynull

that’s why this post is here : dive into that code, and help you understand what i’ve understood by diggin and trying a lot of things.
Like for the past post about kernel module’s build under linux, i’ll go straightforward to the essential.It’s up to you to dig into the links i give, and google for words or concepts you dont understand.
- And dont forget i’m a linux newbie -

coming after my hollidays : The why of a linux module : the char device, ioctl accesses and so on…


cat{ } { post_445 } { } 2009-2015 EIhIS Powered by WordPress