Hi
Here's the termination of a read sequence in the uTasker project code:
if last but one byte to be read, don't send an ack:
I2CR = (IIC_IEN | IIC_IIEN | IIC_MSTA | IIC_TXAK);
else if not last byte
I2CR = (IIC_IEN | IIC_IIEN | IIC_MSTA);
else (last byte)
I2CR = (IIC_IEN | IIC_TXAK);
This uses interrupts.
Perhaps the stop condition is commanded too early in your code. Even if you don't use interrupts you can still poll the interrupt flag but rather than using loops, which could result in critical timing (also dependent on actual I2C bus speed) and writing a command too early.
Eg. (not tested but something like this)
while (I2SR != 0) {} // wait until last unacked byte read has completed
I2SR = 0; // reset the flag for later
MCF_I2C_I2CT &= ~MCF_I2C_I2C_MSTA; /7 stop condition
You can also take a look at the uTasker solution for the M52233. It also includes well tested interrupt driven I2C driver (the project allows also simulating the I2C devices for more efficient development and project testing) - the demo tests ad its use are described here:
http://www.utasker.com/docs/uTasker/uTaskerIIC_002.PDFRegards
Mark
www.uTasker.com