RTOS for dsPIC30F3011

dmehta32 wrote on Saturday, September 12, 2009:

FreeRTOS for dsPIC is already available for dsPIC p33FJ256GP710.
I want to use the same for dsPIC30F3011.
I encountered this error:

port.c: In function ‘prvSetupTimerInterrupt’:

port.c:275: error: ‘TCON_16BIT’ has no member named ‘TCKPS0’

port.c:276: error: ‘TCON_16BIT’ has no member named ‘TCKPS1’

Kindly mention how to get through this.
I have made changes in the RTOSConfig.h so as to include the IC dsPIC30F3011.

mikehibbett wrote on Saturday, September 12, 2009:

The demo code was written for the p33FJ256GP710, and now you are using a different processor. Have you check to see if the peripherals used on the original processor exist on your processor?

At a guess I would say that the p33 has a different set of register names. You might find that the timer being used does not exist on your processor, so you will need to re-write the code to use whatever timer exists on your processor.

Although Microchip are very good at re-using peripherals across different processor types, at the end of the day the two processors are different and you cannot expect them to have the same peripherals, or use the same register names.

You are not the first to find this - I come across it all the time!

Mike

richard_damon wrote on Saturday, September 12, 2009:

On some processors Microchip doesn’t define those individual bits of the timer control register. They do define at TCLK_PS  field that has both of these bits, so you need to change the two statements into one that set them together.

dmehta32 wrote on Thursday, September 17, 2009:

Thank You for your earlier posts. They turned out to be quite helpful.
Going down the line, I encountered this error in case of DSPIC p33f3011:

**…\…\source\portable\MemMang\heap_1.o: Link Error: Could not allocate section .nbss, size = 5122 bytes, attributes = bss near
Link Error: Could not allocate data memory**

I tried configuring the port for DSPIC p30f6010/6011, but again, I faced this error.
Can you kindly help?

dmehta32 wrote on Thursday, September 17, 2009:

I forgot to mention this…
p30f3011 has only 1kb of RAM, p33fj256gp710 (for which the RTOS was ported, has about 30K RAM) and p33f6010 has 8k RAM

richard_damon wrote on Thursday, September 17, 2009:

If you want to use a processor with only 1k, you are going to need to be very careful how you allocate it. It looks like you have heap1 set up to use 5k for the RTOS heap, which is more memory than you have.