Skip to main content
rwa
Visitor II
July 19, 2017
Question

What will take the least processing time to clear RXNE flag

  • July 19, 2017
  • 0 replies
  • 476 views
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
This topic has been closed for replies.