Search code examples
android-things

Do SPI pins on the Rainbow HAT actually work?


I am trying to access a LED matrix via the Rainbow HAT SPI pins.

The LED matrix works fine when connected directly to a Raspberry Pi and to an iMX7D on both SPI channels with the chip select pins, so I can guarantee that the development kits, the LED screen and the code are correct.

When I tried to do the same using the SPI pins that the Rainbow HAT provides it did not work at all, so I am assuming that those pins are either not wired properly or wrongly labeled.

I have tried 3 different Rainbow HATs to check that it wasn't a one-off failure.

Do you know if the pins are properly wired or just wrongly labeled? Have you managed to connect to any SPI device using those pins?


Solution

  • This depends a bit on when your Rainbow HAT was manufactured. The 2017 Rainbow HAT had the SPI breakout pin labels reversed. If your board has CE1 marked next to GND, the labels are incorrect.

    Incorrect SPI Labels

    The 2018 Rainbow HATs have the proper silkscreen pin labels showing the MOSI pin next to GND:

    Correct SPI Labels

    The actual pinout is the same in both cases. If you have the incorrect silkscreen, simply re-wire your peripheral according to the correct image above.