[ECOS] Re: MPC555 serial receive drops bytes

Alex Upchurch alex.upchurch@til.ca
Wed May 7 16:32:00 GMT 2008


Steven Clugston wrote:
> I've been developing an application which makes use of the mpc555 serial
> driver (xxx555_serial_with_ints.c).
> 
> ....
> 
> With the exception fixed, I was still getting overruns so I moved the
> code out of the DSR code into the ISR to improve latency. Since its only
> moving a byte out of a register, I thought it doesn't really need a DSR.
> This improved matters, but the overrun was still occuring.
> 
This sounds like your ISR code can take more than one character time to 
execute. Assuming 8-N-1 data format, a 57600 baudrate works out to 173.6 
microseconds per character. You don't say what speed your CPU is 
running, but I suspect 173.6 uS works out to a *lot* of CPU 
instructions. You should not need to sit in the ISR waiting for the line 
to go idle.

I had the same problem with the Coldfire serial driver. The original 
driver simply masked out the interrupt and called the DSR. That worked 
great until you got some other DSR taking more than one character time 
to execute. The serial DSRs got posted, but they didn't run in time. The 
solution for my driver was to move the data in/out of the UART to a 
circular buffer in the ISR.

I suspect this issue may occur on other platforms as well.

Alex.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list