Jon Hart

IIC (I2C) SDA Line always low??

Discussion created by Jon Hart on Jun 21, 2006
Latest reply on Jun 26, 2006 by Jon Hart
Hi,
 
I am having some difficutly talking to an IIC device. As soon as I set the BEN (IIC enable bit) the IBB (bus busy bit) gets set and never clears.  Since this is the first check done in any transfer, I'm rather stuck.
 
code:
 
void IIC_Start(unsigned int adr) {
 cpuIBFD = 0x1b; 
 
  //****HELP - STUCK IN THIS WHILE LOOP!****
 while(cpuIBSR & 0x20);     // wait for IBB flag to clear

 // NEVER GET TO HERE

 cpuIBCR |= 0x30;           // set TX and master mode 
 cpuIBDR = 0x18|(adr << 1);     // 0x18 = %00011[00/01]0
  
 while((cpuIBSR & 0x02) == 0);  // wait for IBIF flag to be set  

 
 cpuIBSR |= 0x02;               // clear IBIF flag
}

I have checked the SDA line and it is always low (even on a processor reset).  Is this normal?  I am wondering if there is a hardware fault.  I have 10K pull ups on SDA and SCL.  The bus length is a few cm and there are two devices on the bus.

 
Regards
 
Jon

Outcomes