AnsweredAssumed Answered

ADI TWI driver troubles on not connected devices

Question asked by pfeifferc on Apr 14, 2010
Latest reply on Apr 15, 2010 by mabest

Hi,

i'm using a new board with an optional extension board (an additional codec/amp etc.)

This ExtBoard uses a I2C Interface to the codec, and i want to detect if the board is present(via TWI communication).

So i try to communicate via TWI and the specified address.  It's working if Board is connected-but driver hangs in adi_dev.c Line 1218 if not connected.

 

while (pLastBuffer->Seq1D.Buffer.ProcessedFlag == FALSE)

 

Is there no timeoutsupport or handling for not received ACKS? Bit ANACK in TWI_MASTER_STAT is set

 

Whats the correct way to handle this ?

Regards Chris

 

My TWI-Config is

ADI_DEV_CMD_VALUE_PAIR DevAccessTWIConfig[] = {
    { ADI_TWI_CMD_SET_HARDWARE,   (void *) ADI_INT_TWI  },  //previous used is ADI_INT_TWI=9 but now =11
    { ADI_DEV_CMD_SET_DATAFLOW_METHOD,  (void *)ADI_DEV_MODE_SEQ_CHAINED    },
    { ADI_TWI_CMD_SET_FIFO,    (void*)0x0000      },
    { ADI_TWI_CMD_SET_LOSTARB,   (void *)1       },
      { ADI_TWI_CMD_SET_ANAK,    (void *)0       },
      { ADI_TWI_CMD_SET_DNAK,    (void *)0       },
      { ADI_TWI_CMD_SET_RATE,    (void *)(&rate)      },
    { ADI_DEV_CMD_SET_SYNCHRONOUS,      (void *)TRUE      },
    { ADI_DEV_CMD_SET_DATAFLOW,    (void *)TRUE         },
    { ADI_DEV_CMD_END,                  (void *)NULL                     }
  };

 

Outcomes