This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SLAA208



I would really appreciate it if someone can explain to me how th ISR for SLAA208 works. As I understand the interrupt vector USCIAB0TX is just for the transmission. How this works with receiving.

#pragma vector=USCIAB0TX_VECTOR
__interrupt void TX_ISR_I2C(void)
{
if(UCB0TXIFG & IFG2)
{
UCB0TXBUF = I2CBufferArray[PtrTransmit];// Load TX buffer
PtrTransmit--; // Decrement TX byte counter
if(PtrTransmit < 0)
{
while(!(IFG2 & UCB0TXIFG));
IE2 &= ~UCB0TXIE; // disable interrupts.
IFG2 &= ~UCB0TXIFG; // Clear USCI_B0 TX int flag
__bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
}
}
else if(UCB0RXIFG & IFG2)
{
I2CBuffer = UCB0RXBUF; // store received data in buffer
__bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
}
}

Best regards

  • Hi Zack,

    In 2xx, the status flags share an interrupt vector, while the RX and TX share a different vector. This is explained in the UG:

    The datasheet of your specific device includes a table with the interrupt vectors. The table shows that the sources for vector UCB0TXIFG are: "In UART or SPI mode: UCB0TXIFG. In I2C mode: UCB0RXIFG, UCB0TXIFG."

    Regards,

    Luis R

**Attention** This is a public forum