This is the mail archive of the ecos-devel@sourceware.org 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: How to handle very fast repeating interrupts?


Hello,

On Mon, 16 Feb 2009 13:08:34 +0100, Chris Zimman <czimman@bloomberg.com> wrote:

>> I use the scheduler...
>
> Then I'm surprised you're able to maintain the RT requirement that you need,
> because it seems as that any scheduling or kernel event alone may be enough
> to break it.

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.



>> I'd like to place the ring-buffer into the fast onchip sram.
>> Can I just define some symbols in the linker script for that purpose?
>> Or can I tell the assembler to generate some symbols in a special section
>> like
>>
>> .section ".sram_data"
>> _adc_buffer:
>> 	.rept 64
>> 	.long 0
>> 	.endr
>> _adc_buffer_start:
>> 	.long 0
>> _adc_buffer_end:
>> 	.long 0
>
> You probably don't even need to do that unless you have other external code
> that needs to deal with it.

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.

> I mean this is kind of a one-off, so pretty much any solution you come up
> with that's fast works here.
>
> Can you do something like:
>
> my_FIQ_ISR:
> 		[... FIQ setup ...]
>
> 		ldr 	r8_fiq, =ON_CHIP_SRAM
> 		ldr 	r9_fiq, =ADC_READ_ADDR
> 		ldr 	r10_fiq, #COUNT
> 1:
> 		ldr 	r11_fiq, [r9_fiq]
> 		str 	r11_fiq, [r8_fiq], #4
> 		sub	r10_fiq, r10_fiq, #1
> 		cmp 	r10_fiq, #0
> 		bne	1b
>
> 		[... cleanup/return ...]


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.

Thank you,
 Martin L.


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