Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


How convert the jitters to a TICK

Posted by Bill Yang on April 14, 2009

I have a question how to add the jitters to a timer expires. For instance,
//declare a time,
struct timer periodic_timer;
// start a timer in period of two seconds
timer_set( &periodic_timer, configTICK_RATE_HZ * 2 );
// since there are jitters, when timer expired and reset, I need to add these jiffters. below is code.
if( timer_expired( &periodic_timer ) ){
periodic_timer.interval += (( ulMaxJitter * mainNS_PER_CLOCK ) / mainNS_PER_TICK);
timer_reset( &periodic_timer );

..... do something.....
// Note: ulMaxJitter is measured by the high freq task.
mainNS_PER_CLOCK is 20ns.
Because configTICK_RATE_HZ is 200, so mainNS_PER_TICK is 5000000ns.
I wonder if above code is correct?
Bill Yang

RE: How convert the jitters to a TICK

Posted by Richard on April 15, 2009
Please do not create multiple threads on the same topic.


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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo, Nuvoton Cortex-M23 demo & STM32H745 dual core (AMP) demo.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner