Interrupt latencies

OP #1172575
Hi

Not a totally specific GCC question but anyway:
What interrupt latency can be expected on a SAM7A3 part for a GPIO
interrupt? I measured around 60 clock cycles (1.2µs at 48MHz). All code
is in flash.

Placing the ISR to the RAM (with _attribute_ ((long_call, section
(".fastrun")))) doesn't improve the latency. Is this a typical number of
clock cycles for the SAM7A3?

Matthias
Moderator
Matthias Weisser wrote:
> Hi
>
> Not a totally specific GCC question but anyway:
> What interrupt latency can be expected on a SAM7A3 part for a GPIO
> interrupt? I measured around 60 clock cycles (1.2µs at 48MHz). All code
> is in flash.
>
> Placing the ISR to the RAM (with _attribute_ ((long_call, section
> (".fastrun")))) doesn't improve the latency. Is this a typical number of
> clock cycles for the SAM7A3?
>
> Matthias

Exception vectors and interrupt-wrapper (if any) als placed/running from
RAM?
OP
Martin Thomas wrote:
> Matthias Weisser wrote:
>> Placing the ISR to the RAM (with _attribute_ ((long_call, section
>> (".fastrun")))) doesn't improve the latency. Is this a typical number of
>> clock cycles for the SAM7A3?
>>
>> Matthias
>
> Exception vectors and interrupt-wrapper (if any) als placed/running from
> RAM?

No, but that would be my next question: How to place exception vectors
and the interrupt wrappers in the RAM? I think I will need some magic in
the startup asm file.

The question is: Can the number of clock cycles reduced to about 30
clock cycles or so? What about the FIQ and the support in GCC for it? I
am quite new to the world of nonOS ARM.

Matthias
Moderator
Matthias Weisser wrote:
> Martin Thomas wrote:
>> Matthias Weisser wrote:
>>> Placing the ISR to the RAM (with _attribute_ ((long_call, section
>>> (".fastrun")))) doesn't improve the latency. Is this a typical number of
>>> clock cycles for the SAM7A3?
>>>
>>> Matthias
>>
>> Exception vectors and interrupt-wrapper (if any) als placed/running from
>> RAM?
>
> No, but that would be my next question: How to place exception vectors
> and the interrupt wrappers in the RAM? I think I will need some magic in
> the startup asm file.
Not realy magic. Maybe parts from my AT91SAM7S "gamma" example can be
reused.
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html#at91_gamma
There is also a contributed port for the SAM7A3 available from the
web-page.

> The question is: Can the number of clock cycles reduced to about 30
> clock cycles or so?
So far I have not done any measurements on this.

> What about the FIQ and the support in GCC for it?
There is GCC support for this (a function attribute) but it might be
easier to use an assembler-wrapper here too. The gamma example includes
a "FIQ-Wrapper" which has been copied from Atmel's startup-code that can
be found in various "basic*"-examples. You still waste a few cycles with
the wrapper but this can be optimized later if needed.


Martin Thomas

Reply

A question of your own? This thread is over 19 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.