Quality RTOS & Embedded Software

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


Loading

How convert the jitters to a TICK

Posted by Bill Yang on April 14, 2009
Hi,

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?
Thanks,
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.

Regards.


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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