Quality RTOS & Embedded Software

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


dsPIC 30f6014 Port

Posted by dsPICRTOS on September 22, 2006

I make a port of the freertos for the dsPIC30f6014 from microchip under the MPLAB-C30 compiler.

I tested it on a simple board with the flashing led tasks.

Also, I tried to use the simulator for testing the UART functions with Queue services.

Evrything sames ok. Well mi question is
how to guarented that the port is absolutly ok?
do I need to test evry services function individualy? or can I satisfy with some minimal test?

In other way, is there a general method for testing micro-embedded OS?


Abdallah M'ziti El Ibrahimi

RE: dsPIC 30f6014 Port

Posted by Richard on September 22, 2006
Hi - I'm working on the same thing! Well PIC24 anyhow.

The 'standard' demo tasks are designed to provide code coverage to test the port behaviour. They actually provide a very good test.

In addition I generally:

+ Create some tasks that (written in assembler) set each register to known values then check they maintain the expected value as a context switch occurs. I let these run in the background during all other tests.

+ Step through various aspects to ensure correct behaviour - for example switching a task in an ISR, then back to the task from task level and visa versa, etc.

+ Perform tests on context switching within critical regions to ensure status registers and interrupt levels remain at their correct value.

+ Etc....Etc....Etc. It actually takes quite a lot of time and in depth understanding of the source code to know where the potential pitfalls are.

I would be interested in seeing your dsPIC code. I hope to have the PIC24 code released in a couple of weeks. I don't think there is much difference between the dsPIC and PIC24?


RE: dsPIC 30f6014 Port

Posted by dsPICRTOS on September 22, 2006

I well try in depper all the proposed tests.

And also, I well conform the code to your guidance style code writing as you mentionned it in you site web.

It well take me about a week I hope. And then I well give you the code if you want.

Thank you for your help

Abdallah M'ziti El Ibrahimi.

RE: dsPIC 30f6014 Port

Posted by dsPICRTOS on September 27, 2006

I send to you the port of the freeRTOS for dsPIC 30f6014 from microchip.
Please have a look and let me know your comments.

I used the
- 4.0.1 freertos version
- 7.42 MPLAB IDE
- v2.03 MPLAB C30

Thank you

Abdallah M'ziti El Ibrahimi

RE: dsPIC 30f6014 Port

Posted by Richard on September 28, 2006
Thanks for your files. As you know I have been working on a PIC24 port also. I see that you are saving more registers than my PIC24 version, I presume these are dsPIC specific, but will recheck the data sheet to make sure I am not missing anything.

It is interesting to see the different approach taken. I have written the port using inline assembler where necessary, but all within C files.

One thing - looking at your _vPortYield function. It seems that w0 is modified before it is saved in the context. Is this the case?


RE: dsPIC 30f6014 Port

Posted by dsPICRTOS on September 28, 2006
Yes you're wright,
a make a correction by using the Shadow registers as temporary registers for saving the W0.

A send to you the files.


RE: dsPIC 30f6014 Port

Posted by dsPICRTOS on September 28, 2006
Yes as you mentionned it; I wrote a part of the port in assembler because I was fearing that the compiler insert some instructions before saving the context. Also for better performance, a prefer to do the strict minimum things in the switching process since the switch task is usually called and mist be quickly executed for don't disturbing the tasks.

But it's clear that C writing is more elegant style and more easy to modifie, and with modern compilers the code generated is near the assembler hand writing.

For informations, I test the port with-out using optimisation options of the compiler


Abdallah M'ziti El Ibrahimi

RE: dsPIC 30f6014 Port header files for demo

Posted by Nobody/Anonymous on March 21, 2007

I am a new user of FreeRTOS. I have downloaded it and am trying to compile the demo application. I have the Explorer 16 demo board from Microchip.

When I try to build the dsPIC_MPLAB demo I get the following errors:

main.c:68:22: FreeRTOS.h: No such file or directory
main.c:69:18: task.h: No such file or directory
main.c:70:22: croutine.h: No such file or directory
main.c:73:20: BlockQ.h: No such file or directory
main.c:74:21: crflash.h: No such file or directory
main.c:75:22: blocktim.h: No such file or directory
main.c:76:21: integer.h: No such file or directory
main.c:77:22: comtest2.h: No such file or directory
main.c:78:21: partest.h: No such file or directory

The FreeRTOS.h,task.h, croutine.h are included in the demo project. Where are BlockQ.h,crfalsh.h,blocktim.h,integer.h,comtest2.h and partest.h files located?

Can anyone please paste instructions on how to build the demo project in MPLAB?

I look forward to your reply.

RE: dsPIC 30f6014 Port

Posted by Beverlin on November 22, 2009
Hi Abdallah,

Do you have the port for dsPIC30F4011?

Thanks and Kind Regards,


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

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

Latest News

Version 10.1.0 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.


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


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