Hi Steen
DMA on reception is only useful when the frame size is fixed or receive frames terminated by a break condition, or similar, due to the fact that the DMA reception needs to know when it is complete before terminating. Generally when activated it will be set up to receive half the rx buffer length and then wake the handling task. If you don't receive so many characters in your test it has probably stored them in the input buffer but not yet reported that they are there. See the following for more details:
http://www.utasker.com/forum/index.php?topic=140.0In order to lose interrupts it would require interrupts to be blocked for longer than 2 character intervals. At 9600 baud this is about 2.3ms. An overrun would result and thus characters be lost.
To debug this, the following method could be used (assuming UART 0).
1. In
_SCI0_Interrupt() an overrun can be detected by adding if
(USR_UCSR_0 & (UART_OE)) {. A spare post can be set high when this happens and used to trigger an oscilloscope.
2. To monitor blocking interrupts the following can be added to the routines
uDisable_Interrupt() and
uEnable_Interrupt()
- at the end of
uDisable_Interrupt() set a free test port output high
- in
uEnable_Interrupt, when the value of
iInterruptLevel reaches zero, set the port output back low.
When the overrun output triggers you can then see whether the interrupts have really been blocked for a long period of time (> 2.3ms) prior it it happening. If this is the case you will then need to find out what is calling the disable interrupt but not setting it back for so long.
As reference: I recently did tests at 115k baud tx and rx with intensive web server use at the same time. The results showed that a rx interrupt is handled every 88us and lasts about 6,8us. Maximum jitter detected was about 20us (that is the delay to handling a UART interrupt due to other interrupts and/or blocked interrupt periods).
Where potential problems can exist is when FLASH memory is being modified (deleted, written) due to the fact that all interrupt processing has to be stopped while the FLASH is working. Check whether something may be stored in FLASH during the test!
regards
Mark