S32K344 write and read register of FXLS8967AF(3-Axis Low-g Accelerometer) by I2C, but it keeps showing timeout. I can not send datas successful.
Solved! Go to Solution.
I find the reason why i2c send timeout,the scl pin must in input/output mode,thinks for your help.
Hi @shuo41
Section 72.3.1.2 (Controller operations) of the S32K3xx Reference Manual, Rev. 7 states that "Whenever LPI2C is enabled, it monitors the I2C bus to detect when the I2C is idle (MSR[BBF]). If either SCL or SDA are low, the I2C bus is no longer considered idle. The bus becomes idle if a STOP condition is detected or if a bus idle timeout is detected (as configured by MCFGR2[BUSIDLE])..."
Double-check whether the I2C signals are correctly muxed in the SIUL2_MSCR/IMCR.
Also, measure the bus with a voltmeter or scope it with an oscilloscope. Are the SDA, SCL signals pulled up at the time you read the MSR[BBF] flag?
Do you have pull-up resistors on the bus?
B.R.
VaneB
But, Sending status still timeout
I have pull-up resistors on the bus,I measured the pull-up resistance with a voltmeter and it is working properly.
Hi @shuo41
Could you share an oscilloscope image of SCL and SDA?
All the problems have been solved,thinks。
I find the reason why i2c send timeout,the scl pin must in input/output mode,thinks for your help.