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

What does portTICK_RATE_MS stand for?

Posted by Nobody/Anonymous on December 22, 2006
In most platforms portTICK_RATE_MS is defined as "( ( portTickType ) 1000 / configTICK_RATE_HZ )", while configTICK_RATE_HZ is defined as 1000 also. So portTICK_RATE_MS value is 1. What is this? 1 ms per tick? 1 tick per ms?

In the help file I saw:
"// We are to delay for 200ms.
static const xTickType xDelayTime = 200 / portTICK_RATE_MS;"
But I don't understand this. so delay 200/1=200 ticks means delay 200ms? Thanks for any response!

RE: What does portTICK_RATE_MS stand for?

Posted by Richard on December 22, 2006
portTICK_RATE_MS is only used by the demo applications. It is the "tick rate in milliseconds" which is a bad description for the number of milliseconds between each tick. Therefore with a tick frequency of 1000Hz the tick rate in milliseconds is 1 - there is a tick interrupt every 1 ms. With a tick frequency of 100Hz the tick rate in milliseconds is 10 - there is one tick interrupt every 10 ms.

It was intended to allow the demo applications to execute and behave the same at any tick frequency. Therefore in the demo application tasks any delay times are calculated referencing portTICK_RATE_MS. As you change the tick frequency using the application defined configTICK_RATE_HZ the delay periods used by the demo applications would automatically adjust.

I agree it is not clear and it has problems of resolution (does not work at all if the tick frequency is greater than 1000Hz?). It does not however effect the kernel itself, just the demo apps.

Regards.

RE: What does portTICK_RATE_MS stand for?

Posted by Nobody/Anonymous on December 22, 2006
Got it. Thank you! And add a comment in the source code may make it better.


[ 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