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