cancel
Showing results for 
Search instead for 
Did you mean: 

What will take the least processing time to clear RXNE flag

rwa
Associate
Posted on July 19, 2017 at 12:50

To clear the RXNE Flag of an USART, you can either read the RDR register or set the RXFRQ flag in de RQR register.

Which of these two methods will take up the least processing time?

void USART2_IRQHandler(void)
{
 uint8_t c;
 NVIC_ClearPendingIRQ(USART2_IRQn) 
 
 if(USART2->ISR&USART_ISR_RXNE) // data is received
 {
 c = USART2->RDR; // read RDR register
 USART2->RQR |= USART_RQR_RXFRQ; // Send RDR flush request
 }
}�?�?�?�?�?�?�?�?�?�?�?�?�?

#stm32f0 #usart
0 REPLIES 0