A simple serial port driver LCD display driver for the common HD74480 based LCD display modules. Developed in conjunction with retto
Uses Atmel 89C2051 micro
Provison for external output to control backlight and debounced input to monitor button press
+5v to -9V bias adjustment to suite variety of displays
Controls display in 4 bit mode
Uses 11.0592MHz crystal to give standard baud rates
PCB file download here
Download source here
Written in assembly for 8051
Compiles on linux (untested on win32)
Uses the sdcc assembler asx8051
Display geometry can be established via serial port command - protected from lock up due to second controller absence.
Cursor wrapping can be disabled via serial port command
Schematic
Connector Pinout
| 1 | Front Panel button (pulls to ground) | 11 | N/C |
| 2 | Backlight control | 12 | Ground |
| 3 | N/C | 13 | D0 |
| 4 | LCD Display Bias | 14 | D1 |
| 5 | Register Select (RS) | 15 | D2 |
| 6 | Read/Write Select (R/W) | 16 | D3 |
| 7 | Chip Enable Controller 1 (EN1) | 17 | D4 |
| 8 | Chip Enable Controller 2 (EN2) | 18 | D5 |
| 9 | N/C | 19 | D6 |
| 10 | N/C | 20 | D7 |
All characters other than those below are written to the data register of the current display controller. Where the following values are to be written to the data register, the 0xFF escape described below should be used.
| Character | Action |
| ^G (0x7) | Next character determines the level of the external output '0' for 0V, '1' for 5V |
| ^I (0x9) | Next character determines if the cursor wraps within the displays geometry ('0' for no, '1' for yes) This applies within each controller only - the display will always wrap between controllers if more than one is present |
| ^J (0xA) | Line feed - cursor moves to same position in next line |
| ^K (0xB) | Set display Geometry - takes 4 characters as
data. - First character specifies the number of controllers ('1' or '2') - Second character specifies the number of lines per controller ('1' or '2') - Next two character specify the number of display columns in hex eg. ^K1210 specifies a 16x2 display with 1 controller Once the geometry has been received the controller(s) are re-initialised and the display cleared. This takes about 1 second. If the second controller cannot be found then the same geometry is used, but the number of controllers is assumed to be 1. |
| ^L (0xC) | Form feed - clear display |
| ^M (0xC) | Carriage return - return to the start of the current line |
| ^N (0xC) | Report display geometry - outputs a string to the serial port 'G' <a> <b> <nn> where a, b and nn are the parameters as specified in ^K above. |
| ESC (0x1b) | Position cursor - takes a single character to specify the
cursor position
; bit 7 6 5 4 3 2 1 0 ; +---+---+---+---+---+---+---+----+ ; | D | L | character offset | ; +---+---+---+---+---+---+---+----+ ; ; b7 - selects display ; b6 - selects display line ; b5-b0 - selects character offset into current line |
| 0xFE | Control register passthrough. Takes next two characters as arguments. The first '1' or '2' specifies the controller to write the next character to. The character is written into the control register. This can be used for switching the visible cursor on/off etc. |
| 0xFF | Data pass through - as per 0xFE except the data register is written to. Can be used for programming and displaying used specific fonts (see HD74480 data sheet) |
Assembled PCB. Note the small pot replaced with a 10 turn pot to improve the bias sensitivity.
The underside of this board has been butchered somewhat. The original transistor was replaced with a driver chip for better pull down, the -9V on pin six of the MAX232 is quite noisy, an extra 0.1uF cap was added to the feed to wiper of the pot. The rest of the butchering is associated with changing the crystal too often and fitting the 10 turn pot.
The finished product in an ex taxi-cab display housing looks ok (well better than the local weather report).
Error processing SSI element include: Must provide a 'file' attribute to an include at /home/mod_perl/hm/ME/VFS/Interface/HTTP/SSIFileRenderer.pm line 61.