So I’m planning a mobile build using 2 pi zeros and a bunch of HATs and I am unclear on some of the GPIO stuff even after looking at pinout.xyz
So I’ll make a listing of all the HATS I am planning on getting and if there is some configuration on 2 zeros that would work…
So originally I had 4 HATS. The 2.4 inch HAT touch display, enviro, scroll and adafruit Ultimate GPS hat. I would like to add a DAC to the mix.
Is it possible to use stacking headers in order to get everything working together simultaneously? I’d like to have the screen and scroll together on one unit and the dac, gps and enviro on tother unit.
Will this combination work together with no GPIO conflicts?
Most of those pHATs have pins which can be reassigned (eg it doesn’t matter which pin you use for the enviro pHAT, so you can change it in software if there is a conflict).
Right. First off, there is a conflict between the Enviro and Scroll pHATs. But, they are I2C devices, and you can have many I2C devices on one set of I2C pins, so as long as they have different I2C addresses you should be OK. The Enviro pHAT uses addresses 0x77, 0x29, 0x1d, and 0x48. I can’t remember what address the Scroll pHAT uses, but I’d be surprised if there was a clash as I got the impression that the two were intended to be used together.
There is a clash between the PiTFT and the pHAT DAC as they both use pin 21. That could be more of an issue, because the PiTFT needs it as an SPI pin, and the pHAT DAC needs it as an I2S Audio pin. There are two sets of SPI pins (SPI0 and SPI1) on the Raspberry Pi. It could be possible to use the other set, or to have the pHAT DAC use other pins but I’m not very familiar with those devices so I don’t really know. Worth asking someone from Pimoroni and Adafruit I’d suggest.
Those are the only two conflicts I can see. But, there could be more! Even if there are no conflicts, the software could get really messy, the power requirements could well exceed that which should be taken from the GPIO, and fitting them all on will be… fun to say the least!
I would recommend doing one or both of:
A) moving some devices to USB versions (so either use USB audio or a USB/HDMI display)
B) using something like a Perma-proto HAT or a Proto Zero to provide a breakout of the GPIO pins, then wiring up breakouts where possible (like for the DAC, environmental sensors or the GPS) and rewiring the pHATs where you need (for the LCD or Scroll pHAT).
pinout.xyz is the definitive resource for checking pin confilcts. All of the Pimoroni boards are on there, as well as many others from Adafruit, etc, albeit not the Ultimate GPS HAT.