This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Double buffers using US_RPR and US_RCR


Alright, It took a while before I figured it out, but I think your code works as
follows:

ISR:
- receive 1 character, store the character in a buffer
- disable receive interrupt
- start the PDC engine to store any further characters
- trigger DPC

DPC:
- stops PDC engine, process all received characters
- reenable receive interrupt

As the first character is received in the ISR and not in the DPC as it used to
be, the latency is smaller. However, if another interrupt is handled first, it
is still possible to miss characters. Would the following code not do exactly
the same? I know interrupts are not enabled for the ARM target during DPC, but
it should. Else there is no need for a DPC anyway (please correct me if I am
wrong, I am not up-to-date).

ISR:
- receive 1 character, store the character in a circular buffer, increase count
- trigger DPC

DPC: (ISR stays enabled)
- copy circulair buffer
- disable interrupts, decrease count, enable interrupts
- process data


Eric de Jong


----- Original Message -----
From: "Koeller, T." <Thomas.Koeller@baslerweb.com>
To: "'Eric de Jong'" <list_ericdejong_10@gmx.net>;
<ecos-discuss@sources.redhat.com>
Sent: Monday, October 27, 2003 11:10 AM
Subject: RE: [ECOS] Double buffers using US_RPR and US_RCR


Eric de Jong wrote:
> However, it is still possible to lose data. If data is
> received without a
> timeout, the receive buffer will be full. At this point an
> interrupt is given
> and the buffer is swapped and the data is processed. If this
> interrupt is
> delayed by another interrupt, and 2 more characters are
> received, there still
> will be a character loss. This can happen with any burst
> transmission with more
> data than the size of the receive buffer.

If you are concerned about loosing characters by not being
able to respond fast enough, you may want to look at the
driver patch I recently submitted
(http://sources.redhat.com/ml/ecos-patches/2003-10/msg00132.html), which
should not suffer from this problem.

tk
-----------------------------------------------
Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-390
Fax +49 (4102) 463-46390

mailto:Thomas.Koeller@baslerweb.com
http://www.baslerweb.com






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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]