Quality RTOS & Embedded Software

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




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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists