AnsweredAssumed Answered

one byte interrupt in twi

Question asked by windhunter on Dec 2, 2011
Latest reply on Dec 6, 2011 by windhunter

Hello.

 

I try to use twi on bf527 rev.2. I can get slave interrupts, when i set *pTWI_FIFO_CTL = RCVINTLEN; But if is set it to zero interrupts don't happen. I need to receive odd number of bytes, so i need per byte interrupt.

 

Here' s my code

init()

{

   adi_int_SICSetIVG(ADI_INT_TWI, 11);
    adi_int_SICEnable(ADI_INT_TWI);
    adi_int_CECHook(11, TwiCompleteHandler, 0, true);
   
    *pTWI_CONTROL = 10;
    *pTWI_CLKDIV = (25 << 8) | 25;
    *pTWI_CONTROL |= TWI_ENA;
   
    // Slave
    *pTWI_SLAVE_CTL = SEN;

    *pTWI_SLAVE_ADDR = ADR_BF / 2;
     *pTWI_FIFO_CTL = RCVINTLEN;


    // Master
    *pTWI_MASTER_CTL = 0;
   
    // Fifo
    *pTWI_FIFO_CTL = 0;
    *pTWI_INT_MASK = 0xFF;    // master and slave

}

Outcomes