AnsweredAssumed Answered

What will take the least processing time to clear RXNE flag

Question asked by vanoverschelde.b.003 on Jul 19, 2017

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

  }

}

Outcomes