Electronic – How to2C modules select between more than 2 slave addresses

addressingi2cslave

I am using the TMP112 I2C temperature sensor and noticed that you can choose between 4 slave addresses by connecting the A0 pin to V+, GND, SCL, or SDA.

How does the sensor tell between SCL, SDA, and V+?

It makes sense that V+ and GND can set the LSB of the slave address, but I am curious as to how the other two connections work.

Here's the link to the datasheet: http://www.ti.com/lit/ds/symlink/tmp112.pdf

I am using this sensor in an undergraduate senior project and am just curious about how this works. The answer won't affect my use of the sensor; I am just curious.

Thanks

Side note: this is my first question on StackExchange so any feedback on improving my questions is appreciated.

Best Answer

I think that the sensor can differentiate between hard Vcc and ground, as opposed to SCL and SDA, which only have pullups to Vcc. During power up, the device can test A0 sending test data through SDL, then through SDA. If A0 is always zero no matter what the test data, it is connected to GND. If it is always one, it is connected to Vcc. If it follows the status of any of those outputs, the device can know what pin A0 is connected to (SDL or SCA).

Related Topic