public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: "Chris Zimman" <czimman@bloomberg.com>
To: "Martin Laabs" <martin.laabs@mailbox.tu-dresden.de>,
	        <ecos-devel@ecos.sourceware.org>
Subject: RE: How to handle very fast repeating interrupts?
Date: Mon, 16 Feb 2009 12:49:00 -0000	[thread overview]
Message-ID: <AE37CDDF7D55EB4AB77E0D63F38594CB048763@ny2545.corp.bloomberg.com> (raw)
In-Reply-To: <op.upf2gocl724k7f@martin_pc.home>

> Is the FIQ interrupt disabled while scheduling? (And if so - is it
> disabled that long time?) I hope it isn't ...
> The only RT requirement is to read the data from the memory bus
> 12us after the interrupt at the latest. The processing afterwards
> can be done in non-RT.

Interrupts have to be disabled while you're in an ISR, and since the
scheduler is typically driven from a timer interrupt, you are going to run
into that.
I would be concerned that the time it takes to schedule anything may
interfere with the RT window that you need to operate in.

Not being familiar with your project, I can't really say, but if I were to
design something that needed this level of RT performance, I would probably
use a faster processor or a small CPLD/FPGA to help with the data
acquisition.

> I'd like to read the data out of the buffer in a thread to filter and
> store it afterwards. So I need some sort of external accessable buffer.
> I imagine that the FIQ stores the data into a ring buffer and a normal
> eCos thread is going to read out and process the data which accumulated
> in the buffer since the last time.

That's fine -- this can work just the way you want it to.

> Do I really have to use the _fiq appendix for the registers in the FIQ?
> Anyway - this is very like I'd try it. But since a thread has to access
> the buffer I have to implement a ringbuffer. (Because it could be
> interrupted by the FIQ and this would overwrite the data in the buffer
and/or
> corrupt the counter.) And I don't need the loop since there is only one
data
> word I have to fetch each time.

No, the _fiq appendix was just for the purposes of clarity in this example.  

The particulars of how you want to implement this are of course up to you and
beyond the scope of this general discussion.

--Chris

  reply	other threads:[~2009-02-16 12:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 18:13 Martin Laabs
2009-02-15 22:34 ` Chris Zimman
2009-02-16 10:29   ` Martin Laabs
2009-02-16 12:09     ` Chris Zimman
2009-02-16 12:32       ` Martin Laabs
2009-02-16 12:49         ` Chris Zimman [this message]
2009-02-16 12:57           ` Martin Laabs

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=AE37CDDF7D55EB4AB77E0D63F38594CB048763@ny2545.corp.bloomberg.com \
    --to=czimman@bloomberg.com \
    --cc=ecos-devel@ecos.sourceware.org \
    --cc=martin.laabs@mailbox.tu-dresden.de \
    /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).