This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28022: I2c Is it necessary to reset the module after every transfer?

Part Number: TMS320F28022

f28022 I2C issue.

I have followed the tips found at

http://processors.wiki.ti.com/index.php/I2C_Tips

and I see in the sample code, the author is resetting the I2c module from time to time by clearing ICMDR_IRS.

Mostly to clear NACKS and such, but one time he resets the module at the beginning of the transfer.

My application has two slave only devices attached to the Piccolo, and the uP is the only master ever.

Once in a while, the bus seems to hang, in that I will send a STOP, and wait for the STOP to go away in the MDR, but it never does. There are no bus clocks, and the BB is set.

Clearly, this is a flaw of come kind, and I am still tracking it down, but...

Should I wait a while, then after a time out, reset the module and start over or is there another way to clear this situation?

The article talks about putting the pins into GPIO mode and toggling the clock a few times to clear a stuck ACK from one of the slaves. I understand the theory, but In practice, how often does that happen?

The literature, SPRUFZ9D Piccolo I2C Module, section 5.4, says I should wait some time after I set ICMDR_IRS so the BB flag matches the actual bus.

Since I am the only master, is it necessary to wait?

Any thoughts will be helpful.

Thanks,

Mark.

  • After doing more research, I note a part in the mentioned article that says something about needing to set ICMDR_STP before reading the last byte.

    The module is getting stuck when I am reading a single byte from the I2C, and then I was sending STOP after that.

    Put this question on hold for a while till I investigate that problem. I will have to think through my communication protocol.

    Mark.

  • Hi Mark,

    Thanks for the update. If you come back to this question in < 30 days you can probably continue the discussion here. If the thread goes > 30 days without activity, you may want to start a new thread to make sure we see your post.