SparkFun Top pHAT Hookup Guide

Pages
Favorited Favorite 2

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.

Dimensions
Dimensions of the Top pHAT. (Click to enlarge)

GPIO Connections

Note: You may not recognize the COPI/CIPO labels for SPI pins. SparkFun has joined with other members of OSHWA in a resolution to move away from using "Master" and "Slave" to describe signals between the controller and the peripheral. Check out this page for more on our reasoning behind this change. You can also see OSHWA's resolution here.

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.

Top pHAT GPIO
GPIO header connection on the bottom of the Top pHAT. (Click to enlarge)

Raspberry Pi GPIO Map

GPIO Pins Standard GPIO layout on the Raspberry Pi.

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.

Top pHAT Audio
Audio components on the Top pHAT.

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.)

Top pHAT Screen Screen on the Top pHAT.
Top pHAT Screen Cable FPC connector for the screen on the bottom of the Top pHAT.
Note: On the initial released of this product, users may notice that the ribbon cable looks different than what is pictured. That is due to a supply issue; users will have the 2.4" TFT LCD (Touch) Display. This is a drop in replacement screen with an added touch capacity. (The touch is not functional as pins are not broken out.)

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.

Top pHAT LEDs
Six WS2812B addressable LEDs on the Top pHAt.

⚡ Note: The LEDs can draw a decent amount of current at full brightness; ~50mA each for a total of 300mA. This is important as users can brown out their Raspberry Pi if the total current draw exceeds the capacity of the power supply.

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.

Top pHAT Buttons
Button controller components on the Top pHAT.

Qwiic Connector

A connector is provided for attaching other Qwiic devices.

Top pHAT Qwiic Connector
Qwiic connector on the Top pHAT.

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: