I2C-master stops sporadically

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello everybody,

I started experimenting with an I2C connection between a XMC 4500 Relax Kit (as master) and a XMC 1100 2go (as slave).
The basic code and settings are almost identical to the I2C-tutorial, except that master and slave are not on the same hardware.
It works fine if I send a few data, so the code as such and hardware-setup (pull-up resistor, etc.) is ok.

The problem is:
The master stops sending after a while. This occurs very sporadically, sometimes after 20 data packages, sometimes after 200 or more.
It doesn't depend on the data I send, because for testing they are always the same.

It seems the master get stuck in the I2C001_WriteData-function while loop:
while( !I2C001_WriteData( &I2C001_Handle0 , &MasterTxData ) );


and more speciffic, at this point the function returns false and get stuck:

if(USIC_IsTxFIFOfull(I2CRegs))
{
Result = (bool)FALSE;
}


I have no idea what causes this behavior nor how to prevent it.
Does anyone have an suggestion?

Greating from Munich
Sebastian
0 Likes
1 Reply
Not applicable
Do a polling mode, with no fifo.
Then you can monitor the Irq flags via Master & Slave Apps.
Later you can step via irq-handling mode, single transmit and receive.(Master-->Slave).
Flags must have an ACK .... to run this round.
This is the first step to debug... the Apps. on both sides.


Greetings Holger.
0 Likes