Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

(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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS