Quality RTOS & Embedded Software

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




Loading

portTICK_RATE_MS Resolution

Posted by rog57 on December 28, 2012
Hi,
In the "FreeRTOSConfig.h" file, this is declared:
#define configTICK_RATE_HZ( ( portTickType ) 1000 )

In my program, I have this declared:
#define mainLED_TOGGLE_RATE( ( portTickType ) 5000 / portTICK_RATE_MS )

When I use this:
vTaskDelayUntil( &xLastFlashTime, mainLED_TOGGLE_RATE );

I would expect it to flash every 5 seconds; however, it's flashing at about 7 or 8 seconds. After reading the application manual, I think I understand this topic, but clearly I do not. Can anyone point out the error of my ways?

Regards,
Gary





RE: portTICK_RATE_MS Resolution

Posted by Richard on December 28, 2012
I suspect there will be a mismatch between the configCPU_CLOCK_HZ setting and the actual clock frequency being used.

Regards.

RE: portTICK_RATE_MS Resolution

Posted by rog57 on December 28, 2012

That was exactly the problem; I displayed all the clock and peripheral registers and updated the value of configCPU_CLOCK_HZ to reflect that value. It's now working fine.

Thanks for the "timely" help!

Gary




RE: portTICK_RATE_MS Resolution

Posted by rog57 on December 28, 2012
I also want to say the support I've received on this forum is far better than anything I've paid for from any vendor. Great tool, and the assistance is very appreciated!


[ 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