I'd rather hack (or re-spin) a PCB than bit bang I2C.
I think you may be right. I found a combination that requires only one wire to change, so that will be the best compromise.
Having got the scalpel out and made the mod, I now have all three devices talking at the same time using SERCOM 5 for the second bus, as I'm not using the UART port.
Thanks for staying with me and getting me to a good solution in the end
Kevin.
PS I think I made sense of the following line too:
bool begin(TwoWire *theWire = &Wire);
I think it expecting a TwoWire object passed as a pointer and if you don't pass one then it defaults to the address of the standard Wire interface (which is of type TwoWire), hence '*theWire = &Wire'. Do correct me if I'm wrong !
Correct.
Normally a object is created in the sketch, but the Wire object is created in the Wire library itself. That is used as default parameter when nothing was filled in there.
Both hardware I2C libraries and software I2C libraries use blocking functions. The Wire.requestFrom() and Wire.endTransmission() wait until everything has finished. Meanwhile other interrupts are normally running.
That means there is not much difference between them.
Software I2C libraries:
- They use no interrupts themself
- There are often a few issues or incompatibilities
- Multiple I2C buses can be created and the SCL signal can be shared
Hardware I2C libraries:
- Hardware is used for the bus signals
- Hardware is used to detect bus problems
So in the end, a software I2C library is not a bad solution.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.