Quality RTOS & Embedded Software

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




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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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