public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Alex Upchurch <alex.upchurch@til.ca>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] Re: MPC555 serial receive drops bytes
Date: Wed, 07 May 2008 16:32:00 -0000	[thread overview]
Message-ID: <4821D94E.3050409@til.ca> (raw)
In-Reply-To: <96F77944E1BA554D814FBC549EC5D3F00B48603F@moonraker.campus.ncl.ac.uk>

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

  parent reply	other threads:[~2008-05-07 16:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 15:59 [ECOS] " Steven Clugston
2008-05-06 17:55 ` Andrew Lunn
2008-05-07  8:41   ` Steven Clugston
2008-05-07  8:57     ` Andrew Lunn
2008-05-07 16:32 ` Alex Upchurch [this message]
2008-05-08  9:49   ` [ECOS] " Steven Clugston
2008-05-08 20:16     ` [ECOS] " Alex Upchurch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4821D94E.3050409@til.ca \
    --to=alex.upchurch@til.ca \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).