Raspberry Pi GPIO

From ProjectPages
Jump to: navigation, search

Setup

By default, the spi buffer=4096. In order to be able to send the whole ILI9341 screen in one go we have to up the buffer size to 240 * 320 *2 = 153,600 The spidev module is built into the kernel proper (kernel7.img), so you have to set the module parameter on the kernel command line. Add to /boot/cmdline.txt:

spidev.bufsiz=153600

Wiring

In the outside columns are the pin numbers for the Raspberry Pi GPIO connector. The numbers inside are for the specific display I am using.

OLED

Pin Connections - OLED SSD1306
WiringPi GPIO Pi SSD1306 SSD1306 Pi GPIO WiringPi
3V3 1 2 5V
8 GPIO2 3 4 5V
9 GPIO3 5 6 GND
7 GPIO4 7 8 GPIO14 15
GND 9 10 GPIO15 16
0 GPIO17 11 12 GPIO18 1
2 GPIO27 13 14 GND
3 GPIO22 15 16 GPIO23 4
3V3 17 1 - VCC 18 GPIO24 5
12 GPIO10 19 4 - MOSI 2 - GND 20 GND
13 GPIO9 21 6 - D/C 22 GPIO25 6
14 GPIO11 23 3 - SCLK 5 - CS 24 GPIO8 10
GND 25 26 GPIO7 11

TFT

Pin Connections - ILI9341 TFT
WiringPi GPIO Pi ILI9341 ILI9341 Pi GPIO WiringPi
3V3 1 2 5V
8 GPIO2 3 4 5V
9 GPIO3 5 6 GND
7 GPIO4 7 8 GPIO14 15
GND 9 10 GPIO15 16
0 GPIO17 11 12 GPIO18 1
2 GPIO27 13 14 GND
3 GPIO22 15 8 - LED 16 GPIO23 4
3V3 17 1 - VCC 4 - RST 18 GPIO24 5
12 GPIO10 19 6 - MOSI 2 - GND 20 GND
13 GPIO9 21 9 - MISO 5 - D/C 22 GPIO25 6
14 GPIO11 23 7 - SCLK 3 - CS 24 GPIO8 10
GND 25 26 GPIO7 11

Links