Venkatesh TK

HLP: I2C communication in MCF52259 with MQX 3.5 - Fails when context switch happens

Discussion created by Venkatesh TK on Oct 27, 2010
Latest reply on Mar 21, 2011 by Brynn Rogers

I2C communication in MCF52259 with MQX3.5
------------------------------------------

I2C Master - MCF52259
I2C Slave  - Hitachi H83687
Baudrate  - 178571

Initially the communication between I2c Master and Slave has been established. During communication, if the master encounters continuous task switching,the synchronization between the I2C master and Slave is lost.
For instance, say, if the actual number of bytes to be read is 32 and if the communication is lost while transfering the 16th byte, slave is made to free the bus after some timeout. In I2C master also, after some timeout the MCF52259 controller comes out of I2C communication.

But while doing the Flush operation (Using IO_IOCTL_FLUSH_OUTPUT) in the successive I2C communication attempt, the Master  is getting into the foll. while loop in the file i2c_pol_mcf52xx.c and is not coming out.

The exact line in this file is (while ((0 == (tmp & MCF52XX_I2C_I2SR_ICF)) || (io_info_ptr->ONTHEWAY) || ((i2c_ptr->I2CR & MCF52XX_I2C_I2CR_MTX) && (io_info_ptr->TX_IN != io_info_ptr->TX_OUT))); )


Please clarify what the pointers and macros in the above while statement denotes and why the while condition is not getting satisfied.

Outcomes