AnsweredAssumed Answered

Overrun issue while echo with hyperterminal

Question asked by pwdusid on Jun 26, 2015
Latest reply on Jun 26, 2015 by Clive One
Hello, 

Often I get an overrun error when  a char is received from PC. 

uint8_t UART_GetC(uint8_t * const pbyRxByte);
 
void Term_sending(void){
  uint8_t byRxByte;
 
  do {
    while (UART_GetC(&byRxByte) == 0);
 
    while (!((USART1->ISR & USART_ISR_TXE) == USART_ISR_TXE));
 
    USART1->TDR = (uint8_t)byRxByte;
  }
  while (1);
}
 
 
uint8_t UART_GetC(uint8_t * const pbyRxByte){
 
if ((USART1->ISR & USART_ISR_RXNE) == USART_ISR_RXNE)
{
  *pbyRxByte = (uint8_t)(USART1->RDR);  //Receive data, clear flag
 
  return 1;
}
else
  return 0;
}

Sometimes when RXNE is setted overrun error occurs as well. Could someone explain me how to fixe this kind of error. I already checked baudrate and it is ok.
I get this error only when I activate HW flow control RTS/CTS

Best, 

Outcomes