I2C found the wrong address (Actually 1 shifter version)
- 3 replies
- 1520 views
Hello Folks,
I was doing my I2C example, and I realize that the STM board found an address with one left-shifted.
I set my Arduino address as 70 -> 0x46 for hexadecimal
void setup()
{
Wire.begin(0x46); // Wire communication begin
}I connect my STM32F429I_DISC1 and finally make it work with the IsDeviceReady function.
It returns as 0-1-130-131 (I don't know why but not relevant.) and then it finds 140 and 141
When I check my binaries,
70 -> 0100 1100
140 -> 1000 1100
141 -> 1000 1101
when I left shift 70 with 1 bit, I got 140, I have no idea why I am getting 141 (last bit not important maybe?)
So I'm just curious about why it's happening?
I supply my project in here, I didn't add any additional library or so,
I just use CubeMX and CubeIDE (Not even Keil uVision 5)
But since, I am capable of doing I2C communication happen (even with shifted addresses), I want to look forward to complex examples.
Now, what should I send to my slave Arduino, 70 or 140?
Also when I make a scan at Arduino, it gives some I2C addresses, I am not sure which one belongs to my STM32.
There is only STM32 and Arduino connection with SDA and SCL, they have additional 4.7k pull-up resistor connected to 5V output of STM32, and ground of STM and Arduino connected.
Thanks for your attention,
Kind Regards.
