Hello Luis,
Thank you for your response.
We are facing an issue in the i2c interface with our MCU ( K20 ) in our custom board.
We have changed the i/o settings from Port pin for i2c0 ( PTD8 and PTD9 in TWR-K60 ) to PTB0 and PTB1 to suit our custom board.
For this we have edited init_gpio.c file to
pctl = (PORT_MemMapPtr)PORTB_BASE_PTR;
pctl->PCR[0] = PORT_PCR_MUX(ALT2) | PORT_PCR_ODE_MASK;
pctl->PCR[1] = PORT_PCR_MUX(ALT2) | PORT_PCR_ODE_MASK;
sim->SCGC4 |= SIM_SCGC4_I2C0_MASK.
But we are not able to communicate with the device. Is there any other settings required?
The SCK and SDA lines are always set to high.
While running the MQX code it hangs in the i2c_pol_ki2c.c file ,
while (0 == (i2c_ptr->S & I2C_S_IICIF_MASK))
{ }; /* wait for address transferred */
We have connected 3 slave devices in the same i2c0 line.
Please help us to resolve this issue.
Thanks & Regards,
Kiran