FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2011 Threads] 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.
thanks!
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.
Regards.
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! :)
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|