Handling PIN clashes using a HAT Hacker HAT

This is my first project using multiple HATs together, so I wanted to check I got this right!

I’m trying to use a Hat Hacker HAT to support both a Breakout Garden Mini (I2C) and a Pirate Audio (3W Stereo) together on the same GPIO.

If I understand pHAT Stack Configurator, these two boards would have a PIN clash on PIN 36, but it seems this PIN is optional for the Pirate Audio board (in the configuration the controls can be disabled, or seemingly a different BCM PIN used).

On the Breakout Garden Hat Mini (I’m assuming the I2C version is equivalent to the full size hat, PIN 36 seems a bit more important i.e. used for the EEPROM WP.

Here is my theory:

If I disable the Pirate Audio controls (in the mopidy config file) and avoid pressing the button on the board (or even remove it), then they can work together.

Assumptions:

  • The Breakout Garden HAT is the I2C version and not the SPI version (the SPI interface is used by the Pirate Audio for the screen). I assume I also can’t use the Breakout Garden HAT with SPI support, because the Pirate Audio will already be driving it. Please tell me if I can use an SPI version!
  • The Breakout Garden HAT Mini (I2C) is the same PIN configuration as the Breakout Garden HAT (I2C). I assume having 3 slots vs 6 slots is the same.
  • I assume because the Pirate Audio PIN is a button on the board, it won’t be pulled high, unless pressed. I just won’t use the button).
  • I can use my own additional buttons to wire the controls to different BCM of PINs if required. I don’t plan to do this as I don’t need the controls, but it might be worth considering in the future.

Questions:

  1. Will these three boards work together based on my proposed solution?
  2. Could the wiring of boards on PIN 36 cause the EEPROM WP to not work correctly?
  3. What would the wrong signal on an EEPROM WP do to breakout components on the Breakout Garden HAT (I assume open them up to be written to)? Any steps I can take to avoid this?
  4. Is there any software configuration I should check to make sure they don’t conflict?

As described above, I’m new to multiple HATs so any tips welcome!

Huh, TIL Breakout Garden has an EEPROM WP pin.

So off the top of my head the WP pin just tells an EEPROM whether or not to accept data which is being written to it. I think as long as you’re not altering the WP pin and using I2C to write to the address of the EEPROM at the same time you should be fine. If Pirate Audio doesn’t use the I2C bus then I guess that shouldn’t happen?

As far as I know, while the i2c SPI version of the Breakout Garden is wired to SPI0, there is nothing actually connected to SPI if the SPI slots are empty. And even if something is in a slot, another SPI device can be connected as long as they each use a different CE / chip select pin. Or the other device uses SPI1.
I have three of the 0.96 LCD’s wired up and working on SPI1. They are all displaying something but only one display is being enabled and updated at any one time.

For the i2c SPI mini its
port=0,
cs=1,
dc=9,
backlight=19,

For the i2c SPI hat its

Front Slot
port=0,
cs=1,
dc=9,
backlight=19,

Back Slot
port=0,
cs=0,
dc=9,
backlight=18,

Thanks! I’ll give the software route at disabling the Pirate Audio PIN a shot. As you say, it seems unlikely that all of those things will be happening simultaneously.

Awesome. I might give that a go. I was considering a second LCD using the Breakout Garden, so I might pick up one. Thanks!

From the pinout it looks like the Pirate Audio uses SPI0 and CE1 / GPIO 7. And some of the pins used by the Breakout garden SPI are used by the Pirate Audio for i2s. GPIO 18 and 19 for instance. You can still setup a second display, you’ll just have to wire it up without the breakout garden and get creative with which GPIO you use. You can use any one you want for the backlight, and even leave it not connected. The display will still work, you just won’t be able to turn the backlight off.
port=0, #SPI0
cs=0, #GPIO 8
dc=9,
backlight= ?,

  • 3-5V to any 5V or 3V pin
  • CS to BCM 8
  • SCK to BCM 11
  • MOSI to BCM 10
  • DC to BCM 9
  • BL to BCM ?
  • GND to any ground pin