I am using a modified design on a MSP430F2619 based off the example code available here.
In the example code, the DMA will enable UCB0RXIE and UCB0TXIE depending on what operation has just completed. The TX operation makes sense to me. The DMA can't know when to send a STOP signal, so the I2C TX interrupt is enabled to send the STOP. However, the example code reads the last two bytes manually out of the UCB0RXBUF register before sending the STOP signal for an RX operation.
I am curious as to why this needs to happen. If the DMA is setup to read multiple bytes, shouldn't it take care of it automatically? It does that for transmitting multiple bytes . . . .
Out of curiosity, I removed the code that reads the last two bytes in the USCIAB0TX_VECTOR interrupt handler and only sent the stop signal on a receive operation. The code stops working. I noticed that it starts to work if I place breakpoints between write and read operations. If I manually read UCB0RXBUF for the last byte I expected to receive, everything works fine. Why? Why can't the DMA controller take care of the last byte on its own like it does for TX operations?