how to reset I2C peripheral on Kinetis K20?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to reset I2C peripheral on Kinetis K20?

3,593 Views
bowerymarc
Contributor V

The I2C peripheral is getting wedged sometimes and it seems there's no way to completely reset the peripheral - is there?

Nothing apparent from combing the manuals.

Labels (1)
Tags (1)
22 Replies

177 Views
DustyStew
Contributor V

Marc

Nice to know there are still a few technical people around who have common sense. There is a big whitewash happening here.

178 Views
egoodii
Senior Contributor III

What I said was that I didn't know if disabling the clock would effect the 'full module reset' you initially asked for, and outside of that there is no 'single' control available.  If you need a 'graceful return to idle' from MASTER mode from 'unspecifiable causes' (for safety apps or something???), then you will need to do these things:

     If 'I2C clock' is stuck-low, then there is nothing you can do in the I2C realm.  You will need to have an external means to reset the I2C peripheral chip(s).

     If not, wrest control of the I2C pins, bit-bang 9 clocks@100KHz thence a stop (as above) to clear the data line and return all slaves to 'idle'.

     Now clear the 'Master' bit in the Kinetis I2C module.

     At this point you might want to clear some 'leftover' flags (unless your following code clears any flag before use), and especially if you're using interrupts in which case clear 'data available' and the 'pending bit' in the NVIC.

0 Kudos