AnsweredAssumed Answered

Overrun error in UART. How to reset correctly

Question asked by boxeur on Apr 30, 2013
Latest reply on May 2, 2013 by boxeur

 


I receive OE from time to time and if overrun occurs I write 0x02 to status register for reset this error.

After some times receiving terminated and I got only OE in USART ISR instead of DR.

 

 

section("L1_code")

void UART1_STATUS_ISR(void)

{

    u16 stat, err;

    volatile u8 byte;                    /* Принятый байт */

 

    stat = *pUART1_LSR;      /* Приняли статус */

    ssync();

 

    err = stat & 0x1E;

    if (err) {

                              *pUART1_LSR |= err;

    }

 

     if (stat & DR)

               byte = *pUART1_RBR;

               ssync();

 

          if (uart1_ptr->dev == UART_DEVICE_DEBUG)

                   UART1_debug_read_func(byte);

          else if (uart1_ptr->dev == UART_DEVICE_AMODEM)

                   UART1_amodem_read_func(byte);

    } else if (stat & THRE) {          /* transmit */

                   UART1_debug_write_func();

    }

}

 


Outcomes