Bug in Processor Expert generated code for s12zvla128 I2C driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug in Processor Expert generated code for s12zvla128 I2C driver

844 Views
molgyjoseph
Contributor I

 

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 !!

 

 

 

0 Kudos
Reply
1 Reply

830 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Thanks for the sharing.

0 Kudos
Reply