I recently got my hands on a National Instruments USB-6009 Data Acquisition (DAQ) card and decided to write up a driver for the classic Hitachi HD44780 LCD controller. I used the object oriented features of LabVIEW to implement the driver. This allows multiple instances of the LCD to exist concurrently which means that I can have multiple displays interfaced to my PC simultaneously. The results were great!
|The Initialized and Functional Display :]|
I I released the code on NI Developer Zone. Read on to see how I did it!
Read the Datasheet!My first step in tackling any new device is to read the datasheet. I usually give it a skim the first time through within 10 or 15 minutes to get a general feel for the document. Then I zero in on the relevant sections required for me to understand how to initialize the target device and bring it to life.
The Hitachi datasheet was actually quite helpful as it contains a nice command reference. I also found a user manual written by Optrex Corporation that contained some useful timing diagrams and flowcharts relevant to initialization. I strongly recommend this document to anyone who wishes to bring this display online.
HardwareI wired up the DAQ card to the display using the digital lines and one analog output to set the contrast of the display.
|USB-6009 Interfaced with the DMC40457 Display|
SoftwareI started working on the driver in LabVIEW straight away. This is my first time using a DAQ card so I decided to keep it simple and just vary the contrast of the display. The program is simple with an event loop and an analog write DAQmx task.
|Contrast Control Program, Very Simple|
|The private data members of my class|
|Sample Application Front Panel|
|Sample Application Block Diagram|
|Hack a Day and Slogan|