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


MPLAB PIC18F Quick Start question

Posted by David Haile on February 11, 2009
I'm browsing around today between projects and thought I'd give FreeRTOS a try. I've ported the demos to a Microchip PIC18F4680 demo board - it was easy and the code is basically running. I have a couple of questions about FreeRTOS' treatment of Microchip's infamous configuration bits.

1.) How do I tell FreeRTOS how the CPU clock rate? I like to use a 32MHz internal oscillator.

2.) Did FreeRTOS anticipate Microchip's configuration bits? Where did it set them up? I scanned the source and didn't find any instances of "#pragma config" but maybe they did it some other way. Where is this documented?

I'm assuming that I have to add #pragma's to get it to run on the internal oscillator.

I'll eventually figure this out but this forum may give me the answer quicker.

David Haile
Fort Collins, CO

RE: MPLAB PIC18F Quick Start question

Posted by Oleg Mazurov on February 11, 2009
1) #define configCPU_CLOCK_HZ in FreeRTOSConfig.h
2) No.

RE: MPLAB PIC18F Quick Start question

Posted by PICmeup on February 11, 2009
2) again. The PIC32 port sets up bits in main.c with #pragma. The PIC24 port uses the MPLAB IDE settings so no pragmas in source. Cant remember which method pic18 port use.

RE: MPLAB PIC18F Quick Start question

Posted by David Haile on February 11, 2009
Thanks a ton. I'll also checkout the PIC32 port and see what was done with pragma's. That's my preferred method.

RE: MPLAB PIC18F Quick Start question

Posted by David Haile on February 11, 2009
What a pain in the buttocks! I'm just trying to get any of the three standard demonstrations to work on a different processor than how the demo was written - PIC18F4680. I've figured out the linker script file differences, it compiles and runs, but vTaskStartScheduler() always returns - it never starts the tasks. I've gone through the "how to port to your hardware" and have put in a lot of debug code but haven't found the problem. I've increased the stack size to 256 and the heap size to 2048. Those are double the size as distributed.

I'm still working on it but would appreciate if someone would throw some hints up here. I'll give back to this community once I get the code working and become an "expert"!

RE: MPLAB PIC18F Quick Start question

Posted by Oleg Mazurov on February 11, 2009
vTaskStartScheduler() returns when there is not enough memory to start an idle task. Memory for idle task is defined in #define configMINIMAL_STACK_SIZE in FreeRTOSConfig.h. You may also want to take a
look at this:

[ 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