Skip to content

LCD Screen

Quentin Delhaye edited this page Apr 12, 2023 · 7 revisions

This module will control a 1602 LCD screen. It uses the board's GPIOs to send data to the screen using individual wires for each bit. If you did not implement your first GPIO LKM, now would be a good time as the present module will be based heavily on it.

Pinout

Check the documentation of your screen to determine the exact pinout. It should be something like the following:

Pin Label Role
1 VSS GND
2 VDD 5V
3 V0 LCD Contrast: [0, VDD] using a potentiometer
4 RS Register Select, H: data, L: instruction
5 RW Read/Write, H: read, L: write
6 E Enable
7 D0 Data bit 0
8 D1 Data bit 1
9 D2 Data bit 2
10 D3 Data bit 3
11 D4 Data bit 4
12 D5 Data bit 5
13 D6 Data bit 6
14 D7 Data bit 7
15 A Backlight anode (VDD)
16 K Backlight cathode (GND)

Check if your LCD board already has a resistor in series with the backlight anode. If not, add one yourself!

On the BBB side, there are a lot of possibilities, as illustrated on the pinout of the board. For the code examples of this page, we will use the following connections:

LCD BBB
1 P9/1 (DGND)
2 P9/7 (SYS_5V)
3 Potentiometer on a breadboard
4 P8/24 (GPIO_33)
5 P8/21 (GPIO_62)
6 P8/20 (GPIO_63)
7 P8/17 (GPIO_27)
8 P8/16 (GPIO_46)
9 P8/13 (GPIO_23)
10 P8/12 (GPIO_44)
11 P8/9 (GPIO_69)
12 P8/8 (GPIO_67)
13 P8/5 (GPIO_34)
14 P8/4 (GPIO_39)
15 P9/7 (SYS_5V)
16 P9/1 (DGND)

Clone this wiki locally