Quality RTOS & Embedded Software

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




Loading

Fence-Post Errors and xFrequency

Posted by Nobody/Anonymous on April 13, 2006
Hello Richard,

I'm wondering if the mechanism that uses xFrequency
to determine when tasks run takes into account something like this:

Let's say the timer is set to something which yields 256 ticks for 250ms. Should xFrequency be set to 255 or 256? i.e. - 256 'states' since counts start from zero...256 actually means 257 ticks instead?

Maybe the code already accounts for this.

Thanks,
John W.

RE: Fence-Post Errors and xFrequency

Posted by Richard on April 13, 2006
Is this question relating to the vTaskDelayUntil() function, of the mechanism discussed in the other thread we have just posted to?

Could it be a resolution problem? For example, if you want to delay for 256 ticks, then the delay period could be between 256 ticks and (255 + n) ticks, where n is the fraction of time left between the delay function being called and the next tick?

Regards.

RE: Fence-Post Errors and xFrequency

Posted by Nobody/Anonymous on April 13, 2006
Hello Richard,

I haven't looked at that thread to tell you the truth - but I will.

Ex:

Timer_Hz = 1024 (0...1023)
250 ms 'scales' to 256 'counts' - is it really
255 ticks since we're really starting from 0 and not 1 - hence the 'fencepost'.

Thanks,
John


[ 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