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


How to set a Timer > 1000Hz

Posted by CP Kwok on December 22, 2008
I am developing a project on at91sam7se. I set a timer of 10k Hz. However, I found that the timer interrrupt can only be toggled every 1 ms when I set the timer frequency >1000Hz. Is this the limit of the system?

Does anyone have any idea?


RE: How to set a Timer > 1000Hz

Posted by Richard on December 22, 2008
If you are talking about the tick interrupt, then the SAM7 uses the PIT (Periodic Interval Timer) to generate the tick. I'm sure you would be able to make it go very quickly, but you might need to change the implementation of prvSetupTimerInterrupt() in port.c to do this (it might be that you need to use some pre-scales or something on the timer).

Also, the standard demos make a lot of use of the constant portTICK_RATE_MS. If you go above 1ms tick then this will not work. You don't need to use the constant, its just for convenience.

Its best to keep the tick interrupt frequency as low as possible, otherwise you could get into to efficiency issues. If you need a faster timer consider using one of the other timer peripherals in addition to the tick interrupt, then keep the tick frequency lower.


RE: How to set a Timer > 1000Hz

Posted by CP Kwok on December 23, 2008
Thx Richard,

Yes, I notice the system tick is using PIT.

I am using Timer0 to generate the 10kHz, But it's strange that the ISR is called at a limit of 1kHz. I don't see this problem in another module, say UART. Using the same code, I can do it in a stand alone applcation. Thus I am wondering if there are any missing part that I have to change to do so in FreeRTOS.


[ 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