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.
Pros:
Cons:
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 |
---|---|---|---|---|
GND | 2,4,6,10 | 1 | 19 | |
3.3V | 1 | 2,3 | 18 | |
5V | 9 | 20 | ||
SEL | 3 | 3 | 5 | 14 |
CLK | 5 | 5 | 4 | 15 |
DIN | 7 | 7 | 6 | 17 |
DOUT | 8 | 8 | 7 | 16 |
The additional information in this section is not required to make use of the library.
Attach:HpLaserJetLcdFront.jpg Δ
Attach:HpLaserJetLcdBack1.jpg Δ
Attach:HpLaserJetLcdBack2.jpg Δ
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:
Pin(s) | Description |
---|---|
1-3 | Digital outputs |
4 | ? |
5-13 | Digital inputs |
14 | SEL |
15 | CLK |
16 | DOUT |
17 | DIN |
18 | Vcc (3.3V) |
19 | GND |
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):
Bit Number(s) | Description |
---|---|
0 | LCD backlight control (HIGH=On) |
1-2 | Unused? |
3-5 | Digital outputs |
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.