Hello,
I try to write data to I2C bus, but everytime immediately after I set IIC1C_MST bit in I2CWrite() function, IIC1S_ARBL bit is set so I2C interrupt routine is executed. What can cause that it?
void I2CInit() { IIC1C_IICEN = 1; IIC1A = 0x00; IIC1F = 0x8D; IIC1C_IICIE = 1;}void I2CWrite() { IIC1S; IIC1S_IICIF=1; IIC1C_TX = 1; IIC1C_MST = 1; wait_5us(); IIC1D = 0x10;}
Solved! Go to Solution.
What should happen if I run only IIC1C_IICEN = 1 in the main function? I2C pins don't go high after this command.
When I drive PTC2 and PTC3 pins throud parallel input/output module (PTCD_PTCD2 = 1....) everything is ok.