The LCD unit manages a HD44780-compatible LCD.
Demo project: .\Examples\Test_LCD\Test_LCD.PMP
Supported features:
- 4-bit (default) or 8-bit modes.
- 1, 2 or 4 lines (4 lines has never been tested).
- Any width.
- 5x8 and 5x10 user-defined character generator functions.
- The character output procedure may be hooked to the standard WRITE/WRITELN procedures by the ASSIGN built-in procedure; it manages CR / LF and needs $EOL CRLF (default) to work properly when hooked to WRITE / WRITELN.
Default pin assignments:
4-bit mode defaults:
- 0:3 Data bus (low nibble).
- 4 RS pin: Register Select.
- 5 E pin: Enable.
- 6 WR pin: Write Mode (if used, see below).
- 7 Unused.
For 8-bit mode, there's the same default assignment for control lines.
Parametrization:
- Data and control ports may be defined, they may be the same.
- All data bits have to be on the same port. In 4-bit mode they may be upper or lower nibble of the port.
- All control bits must be on the same port. Individual control pins (E, RS, WR) may be defined separately. If one is user-defined, all must be defined also to avoid conflicts with defaults.
- Data strobe and Enable timings may be adjusted.
- See: LCD unit conditional compilation.
- The default timings have been fixed for an HITACHI HD44780U display, that may be qualified as reference.
Nevertheless, some displays may be slower than this model and timings may have to be adjusted, by $DEFINE or directly by adapting the LCD delays constants.