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


PIC32 changing timer?

Posted by ulmus on October 18, 2011
I was searching forum but dont know exactly:
I want to change Timer2 into Timer5. Timer2 which is choosen in PIC32 port is imho not good. Timer 2 is used e.g. in PWM implementation in PIC32. Id like to change timer2 into 5 and want to know if it has something to do with license or not?
And the last thing: anyone has change already timer2? there is some tricks or only changing 2's into 5's in source?
Thanx in advance :)

RE: PIC32 changing timer?

Posted by Richard on October 18, 2011
Just change the implementation of prvSetupTimerInterrupt() in port.c, no problem.


RE: PIC32 changing timer?

Posted by ulmus on October 18, 2011
Not exactly, i can see something else in port.c:

extern void __attribute__( (interrupt(ipl1), vector(_TIMER_1_VECTOR))) vT1InterruptHandler( void );

enough to change _TIMER_1_VECTOR into _TIMER_5_VECTOR, name of function can stay ;)

I hope it's all :)
but about licence: have to do something if i change those points of source?

RE: PIC32 changing timer?

Posted by Richard on October 18, 2011
You are right of course - you also have to change the vector used.

Don't worry about the license. What you are doing is not adding to or modifying FreeRTOS, just changing the peripheral used to generate the tick, nothing need be done.


RE: PIC32 changing timer?

Posted by RĂ©mi Debord on April 25, 2012
We have 4 lines to change:

First, change the Vector,

extern void __attribute__( (interrupt(ipl1), vector(_TIMER_5_VECTOR))) vT1InterruptHandler( void );

Next, change the lines in void prvSetupTimerInterrupt( void ) by these lines (for timer5),

OpenTimer5( ( T5_ON | T5_PS_1_64 | T5_SOURCE_INT ), ulCompareMatch );

and next modify this line in void vPortIncrementTick( void )


Enjoy ;)

RE: PIC32 changing timer?

Posted by ulmus on April 25, 2012
Thanx remidebord, but as you can see, this post is 6 months old :) I have already everything done and all is still working:)

[ 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