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


How to decide on the configTICK_RATE_HZ value

Posted by Shashank on April 16, 2013

I am developing an application based on PIC24 where am trying to interface ADC sensors, UART and some GPIOs. The problem is when I am going to implement each one of these in different tasks. I know that the scheduler does the task swap in and out process based on the priority of the tasks and the time for execution is based on configCPU_CLOCK_HZ value which in turn depends on the frequency at which the controller is running. I modified the sample code in which the default value of configTICK_RATE_HZ was set to 1000 i.e 100 ms. But 100 ms is too much value for my project.

So what is the criteria to decide the value of configTICK_RATE_HZ for a particular application?

Thanks in advance....

RE: How to decide on the configTICK_RATE_HZ value

Posted by Richard on April 16, 2013
configTICK_RATE_HZ sets a couple of things:

1) The granularity of the timing. For example, if you want to block for 125ms then you can block for exactly 125ms if the tick is every 1ms, but only for either 120 or 130ms if the tick is every 10ms.

2) How long each time slice will be if you have more than one task running at the same priority.

Generally you want the frequency to be as low as viable for your application so as not to waist time processing unnecessary tick interrupts.


RE: How to decide on the configTICK_RATE_HZ value

Posted by Richard Damon on April 17, 2013
What I use to set this is to look at the lowest tick rate that gives me acceptable resolution for timeouts (which normally don't need to be very good), and suitable activation for events that need to occur on a periodic basis that can not be based on some other interrupt.

[ 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