Microcontroller used for interfacing with sensor: s12zvla128
Driver Configured using Processor Expert : I2C
IDE : using the CodeWarrior IDE
Issue :
I2C read operation was incomplete with the generated driver files using the processor expert configuration.
The expected data was not read from the sensor using the i2c_read() operation.
After debugging, it is understood that the below line of code was not getting executed , thus the read operation was incomplete.
(void)IIC0IBDR; /* Dummy read character */
Solution :
Replace
(void)IIC0IBDR; /* Dummy read character */
with
dummy = IIC0IBDR; /* Dummy read character */ ( dummy is an unsigned char variable)
With this modification in the generated driver code , I2c_Read() operation was perfect and could read data from sensor.
I am posting this knowledge, if in case anyone face this issue any time with I2C PE configuration.
Thank you !!
Thanks for the sharing.