SparkFun Top pHAT Hookup Guide
Hardware Overview
Below, is an overview of all the hardware included on the Top pHAT.
Dimensions
The overall dimensions of the Top pHAT are 56mm x 85mm. Don't forget to account for the small overhang of the display's ribbon cable, which wraps around the left edge of the board. For more details, users can check out the layout in the Eagle files.
GPIO Connections
As the Top pHAT is also intended to integrate with other HATs, it is important to know all of the pin being utilized to avoid conflicts. Below is a layout of all the GPIO pins being utilized by the hardware on the Top pHAT.
Power Connections
Power to the Top pHAT is supplied through the GPIO pins; both 5V and 3.3V are utilized.
Pin # | GPIO |
---|---|
1 | 3.3V |
17 | 3.3V |
2 | 5V |
4 | 5V |
6 | GND |
9 | GND |
Pin # | GPIO |
---|---|
14 | GND |
20 | GND |
30 | GND |
34 | GND |
39 | GND |
WM8960 Stereo CODEC (I2S)
Pin # | GPIO | Function |
---|---|---|
12 | GPIO 18 (PCM_CLK) | BCLK |
35 | GPIO 19 (PCM_FS) | DAC-LRC |
38 | GPIO 20 (PCM_DIN) | ADC-DAT |
40 | GPIO 21 (PCM_DOUT | DAC-DAT |
WS2812 RGB LEDs
Pin # | GPIO | Function |
---|---|---|
32 | GPIO 12 (PWM0) | Data In |
2.4” TFT LCD Display (SPI)
Pin # | GPIO | Function |
---|---|---|
15 | GPIO 22 | Backlight |
16 | GPIO 23 | RESET |
18 | GPIO 24 | DC |
19 | GPIO 10 (COPI) | SDI |
21 | GPIO 09 (CIPO) | SDO |
23 | GPIO 11 (SCLK) | SCK |
24 | GPIO 08 (CE0) | CS |
Qwiic (I2C)
Qwiic Connector
Pin # | GPIO | Function |
---|---|---|
3 | GPIO 02 (SDA) | Qwiic (SDA) |
5 | GPIO 03 (SCL) | Qwiic (SCL) |
Button Controller (I2C)
Pin # | GPIO | Function |
---|---|---|
3 | GPIO 02 (SDA) | Qwiic (SDA) |
5 | GPIO 03 (SCL) | Qwiic (SCL) |
22 | GPIO 25 | Button Interrupt |
Audio (I2S)
There are four audio components on the Top pHAT; an audio codec, two MEMs microphones, and a speaker. They controlled by the Raspberry Pi using an I2S protocol. The WM8960 stereo codec is the driver behind the audio components. It is used to both drive the speaker output and to control the microphone interface. The MEMs microphones and speaker are used as the input and output components of the audio interface.
2.4" TFT LCD Display (SPI)
The screen on the Top pHAT is most prevalent component on the Top pHAT. The 2.4" TFT LCD Display has a native resolution of 240 x 320 pixels and is backlit by four LEDs. The screen can be replaced using the 40 Pin 0.5mm FPC connector on the bottom of the Top pHAT. (*When replacing the screen, users should verify the replacement has the appropriate connections, driver, and configured in the operating system.)
WS2812 RGB LEDs
There are six addressable RGB WS2812 LEDs on the board. These can be used as indicators, for when you might be too far way to read the screen, but it is still in your line of sight. These LEDs can get very bright; therefore, we recommend using a lower brightness setting.
Qwiic (I2C)
Qwiic is the name of our simple to use connector for I2C devices. It provides a simple, solderless, and polarized connection that should be impossible to mess up. (In case you were wondering, Qwiic is a play on words between quick and I2C.)
Button Controller
Although not an official Qwiic device, the button controller is accessed through the I2C interface. The controller is an ATtiny84, which emulates an I2C peripheral device and is used to read the 5-way switch and two momentary buttons. An interrupt pin is available for more immediate responses.
Qwiic Connector
A connector is provided for attaching other Qwiic devices.
Note: While most of our Qwiic devices should be compatible with the Raspberry Pi, not all have a supported Python package. Users who are unfamiliar with our Qwiic connect system, can check out the video below: