2018-07-12 08:07 AM
Hi All.
We are using the MCU as the I2c-master, and a MPU6050 as the slave.
Following are the I2C-parameters of the MCU (from Cube) :
I2C Speed Mode : Standard
I2C Speed Frequency (KHz) : 100
Rise Time (ns) : 1000
Fall Time (ns) : 300
Coefficient of Digital Filter : 0
Analog Filter : Enabled
Timing : 0x00901D23
Slave Features
Clock No Stretch Mode : Disabled
General Call Address Detection : Disabled
Primary Address Length selection : 7-bit
Dual Address Acknowledged : Disabled
Primary slave address : 0
I2C1_SCL is on PB6, Open-Drain Mode, GPIO Pull-Up, Fast Mode Disabled.
Same for I2C1_SDA.
CAN is being used at 250 KHz, and it functions perfect, with both with/without I2C.
Now, when we use *only* I2C with CAN disabled, I2C's functioning is perfect.
We always get reply/data from MPU6050.
However, when CAN is enabled, I2C *almost* stops working.
I say *almost*, because spuriously we do get data, but 98% of times HAL_BUSY is returned while doing HAL_I2C_Master_Transmit.
One would tend to assume that I2C and CAN are different lines, so functioning of one would not be impacting another.
Unfortunately, I have been trying this for 2 weeks now, but no reliable solution has been achieved.
What could we further try?
Will be grateful for pointers.
Please let me know if I should provide any other information.
Thanks and Regards,
Ajay
#i2c-issue #stm32f303 #i2c-with-can