Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

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:
https://sourceforge.net/forum/message.php?msg_id=5872795




[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner