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


RTOS timing slow on AVR ATMEGA32?

Posted by Nobody/Anonymous on October 7, 2005
I use the function vTaskDelay( ( portTickType ) 500 ); to delay the task and to turn on and off a led.
I notice that the led is flashing at a slower frequency than expected.
In the configuration file the following setup:

configCPU_CLOCK_HZ( ( unsigned portLONG ) 8000000 )

configTICK_RATE_HZ( ( portTickType ) 1000 )

I would think 1ms is one tick??
So a delay of 500 should be half a second??

I'am using an ATMEGA32 with 8Mhz resonator and have CKOPT, SUT0, CKSEL3, CKSEL2, CKSEL1 turned on and programmed with Ponyprog.

RE: RTOS timing slow on AVR ATMEGA32?

Posted by Nobody/Anonymous on October 7, 2005
Have you changed the start up code at all? The function prvSetupTimerInterrupt() in port.c? It works exactly for me. I don't know ponyprog, but I suspect a fuse setting problem.

RE: RTOS timing slow on AVR ATMEGA32?

Posted by Richard on October 7, 2005
Try to verify the clock setting by toggling an LED within a timer interrupt before starting the scheduler. For example, toggle the LED every 1000 ticks to get a 1 second toggle.

Once you have got the frequency correct try the scheduler test again.

I suspect the clock fuse settings might be incorrect.


RE: RTOS timing slow on AVR ATMEGA32?

Posted by Nobody/Anonymous on October 7, 2005
Set the clock fuse settings to the Calibrated Internal RC Oscillator at 8Mhz and it is running fine now.

Thanx for comments, Adrian

[ 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