This library allows the use of the LCD module from many HP LaserJet printers. The library functions virtually identically to the standard LiquidCrystal library, with a number of additional features.
The library and examples are available here: HpLaserJetLcd.zip
See Arduino Libraries for information on how to install libraries. For the purposes of that page, this library is a "user-created library".
At first glance there seems to be little point in trying to make use of a used, proprietary LCD module when brand new, standard 16x2 LCD modules can be had for little investment. However the LCD offers some useful features over the standard HD44780 LCD modules.
Note that the character set does not support lower case. Those character codes are used for additional international characters.
CAUTION: In order to avoid damage to the display module, Arduino or other circuitry, it is important that the only 5v power/signal sent to the display is to the backlight power. When interfacing to a 5v Arduino or other microcontroller, SEL, CLK and DIN should be interfaced using the "diode" method described in this tutorial from Sparkfun. DOUT can be connected directly to a 5v input.
The display should be connected as described below to use the example sketches without modification. Options for different connectors are provided. Connections need to be made to only one connector.
|Description||Arduino digital pin||10 pin IDC keypad connector||7 pin keypad connector||20 pin ribbon connector|
The additional information in this section is not required to make use of the library.
The LCD module features two ICs, one is a HD66710 LCD driver which is backwards compatible with the standard HD44780, and the second being what appears to be a custom ASIC or programmable logic IC. The custom IC provides a clocked serial interface to the LCD driver IC, 3 digital outputs, 9 digital inputs and backlight control.
The pinout of the 20 pin connector is as follows:
|20||Backlight power (5V)|
All logic is at 3.3v except the LED backlight power.
Data is latched and clocked in/out of the display using the same latch and clock signals so care must be taken so that one operation does not interfere with the other. In particular, care must be taken when reading out the digital input state so as not to not cause problems with LCD, backlight or digital output state.
The library always clocks 16 bits between latching operations as this is required to set the LED backlight. It appears to be possible to access select features by clocking in fewer bits however this functionality has not been fully explored and is therefore not fully understood.
To read the digital inputs, SEL must be brought from HIGH to LOW. The first 9 bits presented onto DOUT by clocking CLK correspond to the 9 digital inputs. Further bits output are undefined until SEL is brought from HIGH to LOW again. Note that the act of bringing SEL through HIGH to LOW will also latch the input data as described below, so care must be taken to ensure valid input data has been clocked in before the digital inputs can be latched.
The drive the LCD, backlight or digital outputs, 16 bits are clocked by CLK via DIN, and then latched by bring SEL HIGH and then LOW again. The bits are defined as follows (low bit numbers are clocked in before high bits):
|0||LCD backlight control (HIGH=On)|
|6||Unknown. Set to 0|
|7||HD66710 RS (inverted)|
|8-15||HD66710 data bits 0-7 (inverted)|
When the data is latched in with SEL the custom IC takes care of sending the relevant data to the HD66710 including toggling of the E line. Note that while 8 HD66710 data bits are clocked in at once, the custom IC sends the data to the HD66710 in two 4 bit nibbles. Therefore the HD66710 function set register must be set up for 4 bit communications.