2018-06-29 10:42 PM
Hi,
I have implemented I2C master on STM32F207VG and performing I2C bus scan for slave detection.
I am having a slave device whose I2C address can be modified.
It is working fine with all addresses except addresses 120,121,122,123,124. When I change my slave I2C address to any of these, STM32 fails to detect it, whereas when I am testing same device with Arduino as master it is being detected on bus.
Are there any limitations on I2C slave addresses with STM32 controller?
If no, then what can be reasons for not responding to particular address range.
Thanks in advance.
2018-06-30 05:52 AM
only to say ,
1. make sure you are 100KHz or under to be well within operating speed.
2. no long wires.nothing over 2cm or else you are the problem. drop your speed again
3. strong pullups help, try 1K pullup.
how many devices on the bus ?
2018-07-02 01:54 AM
Hi T J, I am operating I2C bus at 100KHz, I have tested with only one device on bus. Problem is arriving, if i modify slave address between 120 -124.
2018-07-02 04:43 AM
Looking at the I2C specification
https://www.nxp.com/docs/en/user-guide/UM10204.pdf
section 3.1.11, I think 7-bit addresses 0b11110xx are forbidden because they are used to indicate a 10-bit address being used.Can the Arduino cope with 10-bit I2C addresses? If not it might wrongly allow that sequence as a 7-bit address. But stm32 should properly handle 10-bit addresses.
Hope this helps,
Danish
2018-07-03 07:22 AM
Stick a scope on the pins, and confirm a) the address sent, and b) the response from the slave via ACK