Hello Diana, I actually made it work, it was the NVIC issue, LPURAT0 goes to the vector 0 and LPUART1 goes to 1.
I also have another question, I am trying to make my application to work just with interrupts, RX as interrupt ( works fine ) and TX ( as interrupt ) the problem is that TX interrupt is always going to get triggered because the flag is always set ( Empty buffer ) until I put something in the buffer but I still don't want to send anything until I have data in my queue. the problem I have is that the erase mechanism for the flag is writing to DATA register, but I don't want to do it unless I have valid data. please refer to UartService.c
void LPUART0_RxTx_IRQHandler(void) {
static uint8_t count;
if ( ( ( LPUART0->STAT & LPUART_STAT_RDRF_MASK ) >> LPUART_STAT_RDRF_SHIFT ) != 0 ) { // Wait for received buffer to be full
NordicReceiveBuffer();
}
if ( ( ( LPUART0->STAT & LPUART_STAT_TDRE_MASK ) >> LPUART_STAT_TDRE_SHIFT ) != 0 ) {
if ( nordicTxQueue.in == nordicTxQueue.out ) {
return;
}
else {
//for ( count = 0; nordicTxQueue.out != nordicTxQueue.in; count++ ) {
NEXT ( nordicTxQueue.out, BUFFER_SIZE );
SendNordicByte ( GET ( nordicTxQueue ) );
}
//}
}
}
/************ HOW CAN I CLEAR THE TDRE FLAG HERE WITHOUT WRITING TO DATA REGISTER*************//////////
if ( nordicTxQueue.in == nordicTxQueue.out ) {
return;
}
is there another way to clear the flag? is it possible to use RX and TX with interrupts at the same time?