cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 Nucleo I2C_FLAG_BERR

dman
Associate II
Posted on November 27, 2015 at 12:25

Hi,

I am trying to experiment with I2C and have two Nucleo F411 board linked over I2C. I've setup the I2C and something is happening but no matter what I egt I2C_FLAG_BERR error. 

Could anyone explain the error? Further more, does anyone know where I could find information about what these registers do or error explanations. Reading SPL documentation just says #define: I2C_IT_BERR((uint32_t)0x01000100) and I2C_IT_BERR : Bus error flag. 

Thanks
1 REPLY 1
dman
Associate II
Posted on November 28, 2015 at 18:10

I seem to have figured out what the problem was - I think. My master board has address 0x00 and I've set the slave to be address 0x53 (0101 0011) . I've noticed that my oscilloscope was showing 1010 0110 (0xA6). The 0xA6 with Rsh by 1 is 0x53. So, just to make sure I'm right, I've set 0xA6 to be address of my slave and it worked! Whaaat?

Ok, so looking at the code I see this: 

I2C_SendData(I2Cx,(DeviceAddr << 1) | I2C_Direction_Transmitter);

This explains why my 0x53 turns into 0xA6. The questions now I have is how do I tell my slave to turn the 0xA6 into 0x53?

Thanks