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

Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Hi,

I'm trying to write a program for a MSP430 and in my design it is important that one TimerB interrupt is not allowed to disable because it is very time critical and this interrupt can appear in some 10-20┬Ás.
In the freeRTOS I found that global interrupt disable is used (portDISABLE_INTERRUPTS()).
Is there something to keep in mind to change this that all interrupt except the Timer B interrupt?
This interrupt routine will save all changed registers.
Is freeRTOS still executable when one interrupt can appear all the time?

Thanks

RE: Global interrupt disable/enable

Posted by Richard on February 10, 2006
It is inevitable that an OS will from time to time require interrupts to be disabled. This is to ensure consistency of its (ie the schedulers) and tasks structures. FreeRTOS uses a scheduler locking mechanism to allow interrupts to remain enabled for the majority of time while the scheduler data structures are updated - keeping the time interrupts are disabled to a minimum.

10us seems very fast so you may have problems with interrupts being missed even if they are held pending while interrupts are temporarily disabled. You would need to try this on your particular application to know if this was a problem or not.

Allowing interrupts to be nested would help. If you never context switch from within an interrupt this is easy - if you do context switch from within an interrupt then you have to count the interrupt nesting depth and only perform the switch when it was back to zero.

Regards.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Thanks for that information.
When I looked at a scope I can see that sometimes the Timer B output is not correct meaning the interrupt reloading the compare register has not taken place. Since Timer B interrupt has highest priority (except NMI and reset) it can only happen when the GIE is cleared to long preventing the interrupt to take place.
Since the reloading of just the compare register ist a very small routine, I thought to leave this INT enabled all the time. And changing the the
portDISABLE_INTERRUPTS() macro. But I'm not sure if there is any scenario which makes freeRTOS sheduling corrupt.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
Provided the interrupt that reloads the timer does not cause a context switch then leaving it enabled should be ok.

Also check the portENTER_CRITICAL macro implementation which may just call portDISABLE_INTERRUPTS or may have a different implementation depending on the port you are using.

RE: Global interrupt disable/enable

Posted by Nobody/Anonymous on February 10, 2006
I will try out and thanks for that really fast answer!!


[ 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