Quality RTOS & Embedded Software

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


Loading

How to use Timer in FreeRTOS?

Posted by Mudassir Rasool on May 15, 2008
Hi all,

I have read other threads on using timers in FreeRTOS, and I have tried to use vApplicationTickHook. I have made a global variable "time_ticks" which is incremented on every call to vApplicationTickHook, But as I run the code, this hook is only triggered when my task is doing nothing, i.e when I call vTaskDelay. This means that I can only count the ticks of delay of a task. But I need a timer, e.g. I want to calculate how much time is taken by a particular code to run. So i want to save some timer value before starting the task, and then get the value of elapsed time after the task has finished its work.

How can I do it in FreeRTOS? Like in TinyOS, there is Timer module, and you can start a timer and stop it and take its value at any point of time.

Immediate response will be highly appreciated!

Thanks in advance,
--
Mudassir

RE: How to use Timer in FreeRTOS?

Posted by Richard on May 15, 2008
I can send you the timer module donated by Neil. If you would like a copy send me an email to r _dot barry {at} freertos.org.

Alternatively you can make uxTickCount global (provided you are using a 32bit port and uxTickCount is 32 bits, or you are using a 16 bit port and uxTickCount is 16bits] to give you access to the tick interrupt count.

Regards


[ 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