AnsweredAssumed Answered

9S12ZVL IIC software problem

Question asked by hw wong on Dec 26, 2015
Latest reply on Dec 28, 2015 by hw wong

I am trying to control an IIC device from my 9S12ZVL board.

Background:

MPU: MC9S12ZVL32MLF (48 pins)

Dev. System: Code Warrior 10.6 Special (with Processor Expert installed)

 

I am already able to control other IO lines and PWM from software.

 

When I tried the simplest of initialization and testing WITHOUT using interrupt,

I get stuck at the very beginning when trying to send out the very first byte.

 

Would be grateful if someone can give me a pointer as to what I have missed?

 

Thanks.

 

My IIC code segment:

(all macros generated by Processor Expert)

 

IIC0IBCR = IIC0IBCR_IBEN_MASK;    //enable IIC

//set IIC to Enable, Master and Tx mode, NO interrupt (this should send out a START)

IIC0IBCR = (IIC0IBCR_IBEN_MASK  &  IIC0IBCR_MS_SL_MASK  &  IIC0IBCR_TX_RX_MASK);

 

IIC0IBDR = 0x52U;  //write slave address

 

while ((IIC0IBSR & IIC0IBSR_IBIF_MASK) == 0) {}

(The software is stuck here forever).

Outcomes