ras-marques / ImmersiveGloves

MIT License
24 stars 0 forks source link

Add more I2C support to the RP2040 #6

Open ras-marques opened 11 months ago

ras-marques commented 11 months ago

We currently need 2 RP2040 to take care of 6 I2C BNO085 boards, since the RP2040 only has 2 I2C interfaces and the BNO085 can only have 2 different addresses, leaving us with each RP2040 being able to support up to 4 IMU boards.

This could be improved in many ways, either by designing the BNO085 boards to use UART or SPI instead of I2C, but I currently don't have that available. I have already tried implementing bitbanged I2C and the data rate plummets from 100Hz to 8Hz, becoming noticeably choppy.

The RP2040 has a super power though, it's PIO machines, that allow us to program mostly any interface in any pin. I haven't tried I2C with PIO, but will be happy if someone manages to get a BNO085 speaking using a PIO emulated I2C device. This would allow for mode space in the main board and more space = more features.

ras-marques commented 7 months ago

Must try multiplexing I2C on the RP2040 itself, should be possible. What I want to do is reconfigure the same peripheral on other pins between acquisitions. Overhead is probably minimal, but must check.