pic24f / explorer 16 rate is SLOW

x2percentmilk wrote on Sunday, April 24, 2011:

Ok, so I ran the explorer demo, both the board and FreeRTOS right out of the box, no modifications, and everything seemed alright.  I modified the demo code, stripped it of its tasks, and created one simple task

void vTaskFunction( void * pvParameters )
 {
 /* Block for 1000ms. */
 const portTickType xDelay = 1000 / portTICK_RATE_MS;
     for( ;; )
     {
         LATA = ~LATA;
         vTaskDelay( xDelay );
     }
}

to toggle the LED’s on port a.

Everything works, however, instead of taking 1000 milliseconds (1 second) blocks for about 8 seconds.   I have not modified any other settings for it to work like this. A block of 2 ms is still visible to the naked eye.

I can modify PIC configuration bits and oscillator settings, change the configCPU_CLOCK_HZ from 32000 up to 16000000, and see very little change. 

If you need me to post more code or any configuration details please let me know.
Thanks

rtel wrote on Monday, April 25, 2011:

I can modify PIC configuration bits and oscillator settings, change the configCPU_CLOCK_HZ from 32000 up to 16000000

I’m not sure I understand this.  The default setting (the setting in the official demo) is 16000000, so do you mean set it to 32000 *from* 16000000, rather than the other way around.

When using MPLAB, there is the choice to configure the PIC24 fuse settings either through the MPLAB IDE, or from the source code using #pragmas.  I think, from memory, that demo configures the PIC24 device fuse settings through the MPLAB IDE.  Have you changed that in the project?  If you are no longer using MPLAB for fuse setting configurations you will have to add the required #pragmas directly in the code to get the device running at the expected speed.

Regards.

x2percentmilk wrote on Monday, April 25, 2011:

Sorry, I meant that I can modify that setting to almost any value and see very little difference, not sure if that is even related or not.  I am still using MPLAB, are fuse settings another word for configuration bits?  Im fairly certain I tried running it unmodified, and with a variety of other settings, though I try again.  Ill be able to work on this more tomorrow afternoon, until then is there anything else I should look at?

rtel wrote on Tuesday, April 26, 2011:

Yes - I meant the configuration bits.  I was getting the terminology mixed up with AVRs I think.

Regards.