Quality RTOS & Embedded Software

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


Loading

Incorrect definitiion on portmacro.h PIC24

Posted by https://www.google.com/accounts on January 15, 2011
Hello everybody;

The define of portTICK_RATE_MS is wrong for PIC24 :

Original :
#define portTICK_RATE_MS( ( portTickType ) 1000 / configTICK_RATE_HZ )

If configTICK_RATE_HZ == 100, so 100 TICKs per second, then portTICK_RATE_MS egal 10, and the real rate is 100 ms, not 1 ms ...

Correct version :

#if configTICK_RATE_HZ >= 1000
#define portTICK_RATE_MS( configTICK_RATE_HZ / 1000)
#endif

Cordially.

RE: Incorrect definitiion on portmacro.h PIC24

Posted by Richard on January 15, 2011
configTICK_RATE_HZ is not used in the kernel code anywhere. It is provided just for convenience, so you can change the tick rate without having to change all delay and block times. It is used extensively in the demo tasks.

To convert ms into ticks, you divide the ms value by configTICK_RATE_HZ (provided the tick rate is equal to or slower than 1KHz).

If you want to block for 1 second, then you want to block for 1000ms. If your tick rate is 100Hz, you want to block for 100 ticks. In this case, with the definition as it stands, portTICK_RATE_MS would be 1000 / 100 = 10. Converting 1 second (1000ms) into ticks would be 1000ms / configTICK_RATE_HZ == 1000 / 100 == 10 == the right answer.

Regards.

RE: Incorrect definitiion on portmacro.h PIC24

Posted by Richard on January 15, 2011
Correction:

“To convert ms into ticks, you divide the ms value by configTICK_RATE_HZ (provided the tick rate is equal to or slower than 1KHz)”


should have read
“To convert ms into ticks, you divide the ms value by configTICK_RATE_MS (provided the tick rate is equal to or slower than 1KHz)”


Regards.

RE: Incorrect definitiion on portmacro.h PIC24

Posted by MEdwards on January 15, 2011
You can see that the macro name is confusing. Its the same for all ports though.


[ 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