FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2014 Threads] (LPC2148) Fast interrupt and vectored interrupt both from timer0 peripherial?Posted by mikeholtmilch on September 3, 2014 Hello,
I would like to use a FIQ for a capture-event (0.2) along with FreeRTOS, which uses a vectored interrupt from timer0 for tick-generation. The LPC2148 manual states: Each peripheral device has one interrupt line connected to the Vectored Interrupt Controller, but may have several internal interrupt flags. So is it possible to register both a fast and a vectored interrupt for timer0? I tried that already but got system freezes. What I also tried was to modify portISR in the following way:
if ( T0IR & portTIMERMATCHISR_BIT ) { ... }
else { ... }
which works, but is not accurate/fast enough. I also cannot use timer1 for the tick-generation, as it is already used for different purposes.
I would like to know if I just have to try a little harder or give up the FIQ right away. Any help is greatly appreciated.
Thanks, Mike
(LPC2148) Fast interrupt and vectored interrupt both from timer0 peripherial?Posted by rtel on September 3, 2014 Sorry I'm not sure about the FIQ - but note if you do use the FIQ you should probably not use the FreeRTOS API from the FIQ handler.
You can move the timer used to generate the tick to any peripheral you like. As that is quite an old port there is no way of doing that without actually editing the relevant port.c file directly though. Newer ports either declare the functions used to setup the timer as weak, allowing them to be overridden easily, or callback into the application directly to have that set up the tick.
Regards.
(LPC2148) Fast interrupt and vectored interrupt both from timer0 peripherial?Posted by mikeholtmilch on September 3, 2014 Thank you for the fast response.
Sorry to hear that you do not know about FIQ, as this is what I would preferably do. I just want to start timer1 after the capture event, so no FreeRTOS-API will be used. As for moving to another timer, I cannot, because the other timer is already in use.
Just for curiosity: Could I have two normal IRQ for the timer0 peripherial, one which deals with the capture event and the other one which produces the tick for freeRTOS?
Regards,
Michael
(LPC2148) Fast interrupt and vectored interrupt both from timer0 peripherial?Posted by rtel on September 3, 2014
Just for curiosity: Could I have two normal IRQ for the timer0 peripherial, one
which deals with the capture event and the other one which produces the tick
for freeRTOS?
I don't know...in general terms, ignoring any potential hardware conflicts, you should be able to use the FIQ if your not using FreeRTOS API calls in it. Do check the enter/exit critical macros though to ensure they don't disable FIQ as well as IRQ. Also make sure you set up a stack for the FIQ mode as most demos in the FreeRTOS download don't (as the mode is not used by the demo).
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|