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


FreeRTOS and PIC32 need PBCLK to be 12mhz.

Posted by Robert H. Oujesky on April 4, 2011
Using FreeRTOS on a custom PIC32 based board. Literally, just been running for a day! :) I am a newb to both PIC32 and FreeRTOS, so please be gentle. I need the UART to communicate with a device that is running a baud rate of 58,252. Yes, weird! Anyway, to get this baud rate, I need a PBCLK of 12mhz. I cannot seem to find where in FreeRTOS it sets PBCLK. Probably me :( Anyway, I set configPERIPHERAL_CLOCK_HZ to 12000000UL thinking this would do it. I dont think it is right, because I have a LED flashing task which flashes the led every second. when I change configPERIPHERAL_CLOCK_HZ from 40mhz to 12mhz, my led blinks a lot faster (too fast). I am not sure where to look for the correct way to do this. I bought the ebook "Using the FreeRTOS Real Time Kernel - A Practical Guide", but it does not address this at all.


RE: FreeRTOS and PIC32 need PBCLK to be 12mhz.

Posted by Richard on April 5, 2011
You need to look at the C32 libraries (that come with the compiler, not with FreeRTOS.

In main.c you will see a function called prvSetupHardware() that makes a call to the (Microchip) library functions SYSTEMConfigPerformance( configCPU_CLOCK_HZ - 1 ) and mOSCSetPBDIV( OSC_PB_DIV_2 ); You then need to set the configPERIPHERAL_CLOCK_HZ setting in FreeRTOSConfig.h to match whatever you set the clock to using these library functions.


RE: FreeRTOS and PIC32 need PBCLK to be 12mhz.

Posted by Robert H. Oujesky on April 6, 2011
Thanks! That helped a lot. Continuing on! :)

[ 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