RTOS timing slow on AVR ATMEGA32?

nobody wrote on Friday, October 07, 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.

nobody wrote on Friday, October 07, 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.

rtel wrote on Friday, October 07, 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.


nobody wrote on Friday, October 07, 2005:

Set the clock fuse settings to the Calibrated Internal RC Oscillator at 8Mhz and it is running fine now.

Thanx for comments, Adrian