Description
Display pinout description
The alphanumeric display has 12 pins, which are not marked on the board. Each of them corresponds in turn to:
- 1 – VSS – system ground
- 2 – VDD – 5V power supply
- 3 – V0 – contrast
- 4 – RS – select display instruction register (low state) or data register (high state)
- 5 – R/W – read (low state) / write (high state)
- 6 – E – unlocking the display
- 7…14 – DB0…DB7 – data bus
- 15 – LEDA – backlight power supply 5 V
- 16 – LEDK – backlight system common ground
Controlling 2×16 LCD module
The display can be controlled in four modes:
- 8-bit without reading the busy flag – eight lines of the data bus and two control lines (RS, E – RW connected to GND) are needed for transmission,
- 8-bit with read busy flag – eight lines of the data bus and three control lines (RS, E, RW) are required for transmission,
- 4-bit with a readout of the busy flag – for transmission four lines of the data bus and three control lines are needed (RS, E, RW),
- 4-bit without readout of the occupancy flag – for transmission four lines of the data bus and two control lines are needed (RS, E – RW connected to ground).
The most often chosen communication mode is the 4-bit mode without reading the busy flag. Sending half a byte saves valuable I/O pins of the microcontroller – only four data lines are used (in 8-bit mode eight of them are occupied). Not reading the busy flag makes it necessary to use software delays, but saves another line – R/W. This pin can be permanently connected to the ground because data will be transported only one way – to the display.