MC9S08GT60A - I2C arbitration lost

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

MC9S08GT60A - I2C arbitration lost

Jump to solution
2,071 Views
gaminn
Contributor IV

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;}
Labels (1)
0 Kudos
1 Solution
436 Views
gaminn
Contributor IV
Stupid - I had no pullup resistors on the bus.

View solution in original post

0 Kudos
3 Replies
437 Views
gaminn
Contributor IV
Stupid - I had no pullup resistors on the bus.
0 Kudos
436 Views
gaminn
Contributor IV

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.

0 Kudos
436 Views
gaminn
Contributor IV
There can also be problem in I2Cinit() function, because after setting IIC1C_IICEN bit, there is no changeon SDA and SCL lines (they stay low - I guess they should go high after enabling I2C module).
0 Kudos