nox771 / i2c_t3

Enhanced I2C library for Teensy 3.x devices
157 stars 44 forks source link

slave_range configuration gives unexpected results #15

Closed sidewaiise closed 6 years ago

sidewaiise commented 6 years ago

I've tried implementing your slave_range implementation, where I have 1 master device, and a slave with an address range of 0x67 to 0x99.

This seems good in principal, however when I try to run the code... it only seems to allow the address1 address to register. I've tried on 2 other adjacent addresses and there's no acknowledgement of those addresses (Error code 2).

It may also assist in responding to note that:

a) I'm using the TwoWire Wire library for another I2C device on the slave b) I've modified the i2c_t3 library so that the Wire namespace is not duplicated (renamed to WireT3). c) I'm using Wire1 for the master/slave setup on a LC chip.

Please advise how best to get this working.

Thanks

sidewaiise commented 6 years ago

I just figured out the solution.

The Address range was not correct!

The example gives a range from 0x08 to 0x77... however I thought the range extended beyond this.

So this may help anyone else trying to set up a slave-range application... use the range provided in the example (or a subset of).

Thanks

nox771 commented 6 years ago

It is correct that an address of 0x99 will not work as I2C address range is 7-bit, not 8-bit, so max is 0x7F. Further per spec the addresses at the very top and bottom of the range are reserved and should not be used, which is why the example uses 0x08 to 0x77. Any address within that range should be ok.

sidewaiise commented 6 years ago

Thanks for Confirming Brian, all is working now. Great library! Cheers

Sent from my iPhone

On 6 Dec 2017, at 5:04 am, Brian notifications@github.com wrote:

It is correct that an address of 0x99 will not work as I2C address range is 7-bit, not 8-bit, so max is 0x7F. Further per spec the addresses at the very top and bottom of the range are reserved and should not be used, which is why the example uses 0x08 to 0x77. Any address within that range should be ok.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.