Quality RTOS & Embedded Software

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


lowering system tick or timer ISR

Posted by zvonko on May 11, 2010

atmega32, 8 mhz clock, 1 ms system tick (default)

i need to service an event every 800 microseconds ( display refreshing sort of event)

what would u guys recommend, separate timer ISR for this or maybe lowering the system tick
value to 800 microseconds ?


RE: lowering system tick or timer ISR

Posted by Richard Damon on May 11, 2010
The first question comes on the details of the 800 microsecond "display refresh". Is this needing to be synchronized to the display? (If so, just changing the timer isn't apt to be sufficient). Is this for an access delay? (note that to get an accurate "at least 800 microsecond' delay, an 800 microsecond timer is not good).

If this is the only thing that needs this level of timing, (especially if it doesn't need it all the time), to set up a dedicated interrupt for this timing and level the system tick alone (or maybe even slow it down).

As to my comment on the system timer not being good for delays with a minimum requirement, the issue is that a vTaskDelay(1) will delay to the next tick, not for a full period of a tick, that says the task will be put back on the ready list anywhere from 0 microseconds (if it make the call just before the timer tick) to a full timer tick period (if it calls just after). Thus the shorted guaranteed delay is a vTaskdelay(2) which will for sure delay 1 tick, and up to 2 ticks (more if a higher priority task is running). If you really want accurate 800 microsecond delays, you need to use a dedicated timer in a one shot mode that you trigger when you need it and wait for a semaphore, that the interrupt will raise when the time is up.

RE: lowering system tick or timer ISR

Posted by zvonko on May 11, 2010
im not sure i understand, i.e. the last sentence is a bit confusing, where would you wait for a semaphore ?

its a small array of LEDS, 8 rows x 23 columns, each row is refreshed every 800 microseconds, i.e. each row is turned on
for approx. 800 microseconds, if i exceed this timing , screen flickering can be seen, i mean it does not have to be exactly
800 microseconds , 100 microseconds up or down could be tolerated, this would only affect brightness of leds

how would you approach to this example with 1 ms system tick and 8 Mhz clock,
what is a good value for system tick anyway , the default is 1 ms in atmega32 port that is why i mention it

the data for the whole array is stored in array variable in RAM

[ 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.


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


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