Oops..[*]All HAT EEPROM have the same address.* Outside of pin conflicts this is the primary reason they cannot be stacked.
It was a deliberate decision.
While I don't have any inside information I imagine it was taken in order to keep the bootloader small and fast. If any address were permitted the boot loader would have to rpobe every device conected to i2c0 to see if it is an EEPROM, if it has the correct data, and then to potentially resolve conflicts.
I also suspect that as a board meeting the HAT spec connected to all 40 pins whether it used them or not there was an element of no-one is gona be able tophysically connect two HATs anyway.
[
However, with respect to the specific case of stacking Sense HAT on top of Build HAT, I suppose it is still doable. Specifically, leave pin #17 of the 40-pin header unconnected. (For example, if you would use a tall header, simply cut pin #17 off..)
The reason one can do this is that the ID EEPROM circuit of the Build HAT can only be powered through pin #17. Meanwhile according to its schematics, the Sense HAT can still get 3v3 power through pin #1.
There's no need for hardware mods (well, not beyond duplicating the 40 pin header). i2c is a multidrop bus.Multiple devices can be connected and powered on at the same time. The problem is that when the master tries to communicate with two devices that have the same address it doesn't know which one it's talking to, there is likely going to be some bus contention as they both try to answer, and the device that answers the first time might not be the device you next get data from.
If you disable the HAT EEPROM probe* both EEPROMs will sit on the bus waiting for a message from the master (the Pi) that never comes. Slave devices (the EEPROMs) cannot initiate a transfer, a master has to do that.
As I said above, without the EEPROM probe (or with various hardware hacks to disable one or both EEPROMs) you need to manually load the relevant devicetree overlays via your config.txt. Overlays are doucmented in /boot/overlays/README and in the official documentation linked from the top of this page.
I don't posses a sense HAT or a build HAT so canot advise as to which overlays are required.
*: By adding force_eeprom_read=0 to config.txt outside of any conditional filter.
Statistics: Posted by thagrol — Fri Sep 27, 2024 11:48 pm