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




Loading

Tick timing error - V5.3.0 AVR32_UC3 port.c

Posted by David Squires on June 11, 2009
After upgrading an AVR32 UC3A project to use the latest FreeRTOS V5.3.0, I noticed that the delays generated by vTaskDelay were half as long as expected. Further investigation revealed that when the default configuration in FreeRTOSConfig.h has:

#define configTICK_USE_TC 1
#define configTICK_TC_CHANNEL 2 // Note: actually any channel would have the same issue

that the initialization of the timer counter in waveform mode has a mistake. Specifically, when the RC register is loaded on line 446 of port.c, the expression for the value to be loaded into rc assumes that the timer/counter TIMER_CLOCK2 has a frequency of PBA clock/4. The actual rate of TIMER_CLOCK2 is PBA clock/2 per section 12.4.1 of the latest UC3A datasheet.

So, I believe that line 446 of port.c should be:

tc_write_rc( tc, configTICK_TC_CHANNEL, ( configPBA_CLOCK_HZ / 2) / configTICK_RATE_HZ );

With this change made, the timer ticks occur at the expected rate.

David Squires,
Squires Engineering, Inc.
Melbourne, FL

RE: Tick timing error - V5.3.0 AVR32_UC3 port

Posted by MEdwards on June 11, 2009
There has been an on going saga with the AVR32 demo due in part to the compiler versions changing and breaking the build and also in part to different silicon revisions working in different ways. I think these are noted in the bug tracker.

RE: Tick timing error - V5.3.0 AVR32_UC3 port.c

Posted by David Squires on June 11, 2009
Ah, this I can well believe. In researching the parameter values for setting up the UC3A Timer/Counters in waveform mode for my project I noticed that some of the bitfields have different encodings based upon the silicon revision.

So I will add for completeness that my observations apply to an UC3A0512 which is silicon rev I.

Also, I am using AVR32 Studio V2.02 along with the gnu toolchain that was distributed by Atmel for that release.

Thank you for the information.

Dave Squires
Squires Engineering, Inc.


[ 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