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


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