Quality RTOS & Embedded Software

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




Loading

rtos and high speed interrupts

Posted by Freppac on July 30, 2008
Hi

Im planning on using freertos for an UAV project on the at91SAM7 uC. Im fairly new to RTOS and completely new to FreeRTOS , so I have a question that might be a bit stupid :)

The thing is that I need to generate several servo control signals (a pwm signal between 1-2ms with an update rate of at least 50Hz) and to generate these signals I need to set up a fast running timer/counter interrupt (my guess is that 100kHz interrupt freq is enough to obtain a good resolution)
How would this affect FreeRTOS performance, or is it even possible to do something like this with an RTOS?

RE: rtos and high speed interrupts

Posted by Richard on July 30, 2008
This depends on the port you are using. Here are some examples:

1) Cortex M3

Cortex M3 ports allow interrupts above the kernel interrupt priority (this feature is extended even further in the next release) so these interrupts are never held up by the kernel activity at all. The demos applications run a high frequency timer interrupt at 20KHz then measure the jitter in the interrupts execution - which comes out between 80ns and 160ns depending on the frequency at which the CPU is running. This jitter is totally an effect of the interrupt tail chaining (a feature that allows you to short cut interrupt entry) and nothing to do with the kernel. I have not tried a 100KHz interrupt, but at any frequency if the interrupt is above the kernel priority then it will not get delayed by the kernel so its just a matter of whether or not the processor can operate that quickly.

2) PIC32

Likewise on the PIC32 you can run interrupts above the kernel interrupt priority. Although the measured jitter is a little longer when defining normal interrupts you have the option of using the level 7 priority and therefore the shadow registers which should give you super fast and accurate interrupt entry as the context need not be saved.

3) ARM7

On the ARM7 you can use the FIQ interrupt, but make sure that the critical section entry code only disables IRQ interrupts, not FIQ interrupts.

etc.

The best thing to do is buy an inexpensive eval board and give it a try.

Regards.

RE: rtos and high speed interrupts

Posted by David Anderson on July 30, 2008
Just curious why the hardware PWM channels won't work. A 100 kHz interrupt tick will burn a lot of processor time RTOS or no RTOS, especially on an ARM7 which has relatively poor IRQ latency.

RE: rtos and high speed interrupts

Posted by incrediball on July 30, 2008
It is certainly possible. As David said, the best way would be to use the PWM output(s) and then you only need to update it at 50Hz. However bit banging an output at 100kHz is also possible. I wrote about high speed interrupts on the AT91SAM7S several months ago in http://sourceforge.net/forum/forum.php?thread_id=2005665&forum_id=382005 . Perhaps that might give you a few clues.

RE: rtos and high speed interrupts

Posted by Freppac on August 1, 2008
Hi and thanks for your answers!

Well the basic reason why i cant use the pwm outputs is that i need to control a lot of servos, and I think that the sam7s only has 4 pwm outputs right?

but I probably will solve this by using another smaller uc for servo output generation. I think that this will probably be a better solution, so that the main processr will not be overloade by just generating servo signals.

RE: rtos and high speed interrupts

Posted by srk_embedded on October 21, 2011
Hi I too have a similar question.I am using FreeRTOS on a dsPIC.I had read on the free RTOS website that there are specific macros to manage interrupt nesting and allows interrupts above a user-definable priority level to remain unaffected by the activity of the kernel. Using FreeRTOS will not introduce any additional timing jitter or latency for these interrupts.
I have a similar high speed adc interrupt.
Could some one point out which macros control this behavior or it depends on a particular port?

RE: rtos and high speed interrupts

Posted by Dave on October 21, 2011
They are documented on the documentation page for the dsPIC port on the FreeRTOS web site. Look at the port specific configuration section http://www.freertos.org/portpic24_dspic.html


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists