AnsweredAssumed Answered

Slave I2C and Variable Length Receive

Question asked by Joshua Einstein on Feb 8, 2013
Latest reply on Feb 15, 2013 by Joshua Einstein

Hi-

 

I'm trying to implement Slave I2C bean on a Kinetis K10, and am a bit confused about the interaction between CancelBlockReceive, GetReceivedBlockStatus, and the ISR and it's associated OnError masks.

 

Looking at the PE code, it looks like an RX cancel will always generate a SLAVE_RX_OVERRUN error as the cancel block receive function doesn't actually cancel and clear out the receive block so much as sets the requested number of bytes to 0.

 

I'm working with SM Bus burst reads and with a custom protocol that sends both strings and 16-bit values, and it looks like the only way to handle a NACK from the master is to process the error and generate an RX Overrun error. With the I2C bean as it is, is it necessary to process every byte as it is received and use the UpdateNumReceivedBytes, or is there some better way of managing variable length messages?

 

Thanks!

Outcomes