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


Timer callback intrval accuracy

Posted by joe_her on October 25, 2016

I wonder what accuracy can I get for the intrvals of the timer callback routine. For example if I set it to 100 ms, System tick is 1ms, and the callback is short, how many ticks will it miss(if any)? Is it better, or is it the same as read system ticks and wait with taskDelayUntil() in a task loop (instead of using timer callback)? Thanks Johanan

Timer callback intrval accuracy

Posted by edwards3 on October 25, 2016

The accuracy is set by the tick frequency and the priority of the timer service task relative to other tasks.

All timing, including when a timer callback function is executed, is limited by the granularity of the configured tick frequency.For example if you block a task for 10 ticks and the task enters the blocked state immediately before a tick interrupt the time the task blocks for will be closer to 9 ticks than 10, maybe 9.05 ticks. If instead the task entered the block state immediately after a tick interrupt the time the task blocks for could be 9.999 ticks.

Timer callback intrval accuracy

Posted by joe_her on October 26, 2016

I can set normal task priority, but I don't see how to set a software timer priority that runs a call back function. So if I need a function that will run every 100 ms, and I can tolerate some +/- gittter on the interval, but would like that the average time will be as accurate as possible (that is after 1000 seconds it will run 10000 times), what is the best way to implement it? (softwre timer? waitUntil? or any other idea..)

Timer callback intrval accuracy

Posted by rtel on October 26, 2016

See http://www.freertos.org/RTOS-software-timer.html and in particular the description of configTIMERTASKPRIORITY on http://www.freertos.org/Configuring-a-real-time-RTOS-application-to-use-software-timers.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