[통신]

UART에서 Overrun Error 란?

Neo Park 2012. 9. 5. 15:26

 

UART Overrun Error


What is meant by Overrun error in UART and what considerations should be taken to overcome it?

 
Overrun error occurs when another byte of data arrives even before the previous byte has not been read from the UART's receive buffer.  This is mainly due to time taken by CPU to service the UART interrupt in order to remove characters from receive buffer. If the CPU does not service the UART interrupt quick enough and does not read the received byte before the next arrives, then the buffer becomes full and an Overrun error occurs.  Below are some tips to avoid overrun errors.

 

1. Run the CPU at the maximum possible speed.  This will speed up the execution of the UART interrupt (and any other interrupt too).

 

2. Keep the UART ISR efficient and as short as possible.  For example the ISR could just read from the UART's RX buffer and transfer it to a RAM buffer and set a flag.  The processing of the received data could be done in the foreground. 

The time taken to execute the ISR should be less than the time taken to receive the next data byte.

 

3. Writing a C ISR pushes and pops all the virutual registers, paging registers and A and X registers.  This increases the time taken to execute an ISR.  Write the UART ISR in assembly to make it more efficient.

 

4. Other interrupts in the program can also create interrupt latencies which could result in overrun errors.  Under such circumstances, reducing the baud rate of the UART will also prevent the overrun error. 

 

'[통신]' 카테고리의 다른 글

TCP/IP 패킷 구조  (0) 2012.09.10
RS232와 비교하여 RS422, RS485는 어떻게 다른가?  (0) 2012.09.07
MUX(multiplexer) 다중화 장치란?  (0) 2012.09.03
[네트워크] Packet의 구조  (0) 2012.08.22
UART bit stream 구조  (0) 2012.08.14