8 years, 5 months ago.

I2C bus Error

Hello Frank Vannieuwkerke,

I've been trying to find methods for recovering from an I2C bus error on KL46Z microcontroller. I've tried out the code posted by you on https://developer.mbed.org/users/frankvnk/code/KL25Z_I2C_busreset/file/e9beb537cf77/I2C_busreset.cpp But the code is getting stuck in the while loop where the PTE24(CLK) is continosly toggled. I've checked using an oscilloscope and found out that despite sending a large number of clock cycles from the master, the slave is not releasing the bus(slave holds the CLK and SDA lines LOW). Is there any other way of recovering from this error without having to reset the microcontroller?

Edit: I've run this code on KL46Z though it was written for KL25Z because the I2C structure is the same for both.

posted by Prasanth B J 17 Jun 2016
Be the first to answer this question.