I'm not being able to understand the difference between TXCPTIFG and TXIFG in the UCAxIFG register from UART of MSP432. I am trying to use UART in the UART Mode, just to send characters to a PC, but both are set together when transmit interrupt occurs. The User Guide explanation is:
TXCPTIFG - Transmit ready interrupt enable. UCTXRDYIFG is set when the entire byte in the internal shift register got shifted out and UCAxTXBUF is empty.
TXIFG - Transmit interrupt flag. UCTXIFG is set when UCAxTXBUF empty.
If the user guide is correct, both will set when UCAxTXBUF is empty after transmission of a character. But whats the real difference?
Maybe, the right question should be: Whats the difference between UART_TRANSMIT_INTERRUPT and UART_TRANSMIT_COMPLETE_INTERRUPT?
I only enabled the EUSCI_A_UART_TRANSMIT_INTERRUPT, as can be seen in the code snippet bellow.
/* Enabling interrupts */ MAP_Interrupt_enableMaster();// MASTER MAP_Interrupt_enableInterrupt(INT_EUSCIA0); // NVIC MAP_UART_enableInterrupt(EUSCI_A0_MODULE, EUSCI_A_UART_TRANSMIT_INTERRUPT);//PERIP.
If I'm not mistaken the TXCPTIFG flag are triggering EUSCI_A_UART_TRANSMIT_INTERRUPT. I belived that only TXIFG could do it, while TXCPTIFG should trigger UART_TRANSMIT_COMPLETE_INTERRUPT, if that interrupt source is activated, but isn't my case.
Moreover, how to clear TXCPTIFG using driverlib? My first impression is that driverlib allows only clear the flag TXIFG. I used the the following code:
uint32_t status = MAP_UART_getEnabledInterruptStatus(EUSCI_A0_MODULE); MAP_UART_clearInterruptFlag(EUSCI_A0_MODULE, status);
but only TXIFG is cleared.
Thanks!