LCD register port is P0, LCD address port is P2, bits[235].
LCD memory is layout as such: 8 lines, 128 columns. Each cell is a byte of memory corresponding to 8 pixel in a line, arranged vertically.
To issue a command to LCD, set P2 to xx0×00xx, then write P0. To issue data set P2 to xx0×10xx, then write P0.
When issueing a command, high nibble of P0 is the command type, low is the command argument.
The known commands are :
| 0×0 | set current column low nibble |
| 0×1 | set current column high nibble |
| 0xB | set current line |
Issuing data sets the current cell content, and increments the current column.