Avnet Electronics Marketing - Community Forum
    |   
 
Home Design Services My Account About Avnet
Reply
Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

I2C Bus Busy Reset



Can anyone tell me how to reset bit 2 (BB - Bus Busy) in the CR register (I2C core) when a stop condition doesn't occur? I would like the configuration untouched so I don't have to re-initialize the core.
Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: I2C Bus Busy Reset

BB is in Status Register (SR), which is a Read only register.

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: I2C Bus Busy Reset

Correct, but how do I reset the core to clear the BB?

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: I2C Bus Busy Reset

Writre to the SOFTR register (this is documented in the I2C core datasheet).

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: I2C Bus Busy Reset

I read about that but I wasn't sure if the core needed to re-initialized.  Do you know?  I looked through the .c .h files and I couldn't find anything on how to write to the SOFTR register.  Can you point me in the right direction on how to do this?

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: I2C Bus Busy Reset

According to the datasheet, the SOFTR register offset is 0x040, so simply do a memory write to the (I2C BASEADDR)+0x040.

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: I2C Bus Busy Reset

Thank you.  Do you know if it clears the core initialization?

Avnet Employee
npoureh
Posts: 339
Registered: ‎05-05-2009
0

Re: I2C Bus Busy Reset

It forces all core registers to their default values (you can take a look at the default values in the datasheet).

Contributor
heedaf
Posts: 11
Registered: ‎11-16-2010
0

Re: I2C Bus Busy Reset

Bummer!  I was hoping to avoid that.  Thanks for you help.