preemptive scheduling whith MSP430f169

nobody wrote on Monday, May 16, 2005:

im create two tasks whith the same priority for testing the
preemptive scheduling working with MSP430F169 and I use
the following configurations:
#define configUSE_PREEMPTION        1
#define configCPU_CLOCK_HZ                 32768
#define configTICK_RATE_HZ             1000

was espected that the scheduler share de CPU whith the both tasks switching the context of the task. correct?
but it is not be hapenning
can I be making something wrong?

rtel wrote on Monday, May 16, 2005:

32768 is a very slow CPU speed.  Is this the actual >internal< speed the core is running at, or just the xtal speed.  This parameter needs to be the internal speed (after multiplication, etc.).

If 32768 is the internal CPU speed then you will have to use a slow tick rate, I think 1000 Hz as per your setup is too fast for such a slow CPU.

Finally - what priority are your tasks running at?


nobody wrote on Monday, May 16, 2005:

I create two tasks, and set the priority 2 for both tasks.

I defined the maximum task priority as 3
#define configMAX_PRIORITIES  3

i take de value of frecquency of the CPU in datasheet of msp430f169 in


nobody wrote on Monday, May 16, 2005:

The datasheet does not tell you the frequency at which you are running the device only how to setup the clocks.  It is possible that the exteral clock is 32K, but the internal processor frequency depends on the register setup.

Look at the function prvSetupHardware() in the FreeRTOS/Demo/msp430/main.c file.  This sets up the FLL within the msp430 to multiply the external clock frequency in order to generate the faster internal frequency.  To complicate things there are more than one frequency to setup.  You need to know the internal frequency at which you are running your hardware - then use this as the constant in FreeRTOSConfig.h.

Maybe you have not changed this function in which case the frequency could be 8MHz also?  If this is the case you could try setting the configCPU_CLOCK_HZ setting back to the value as downloaded to see if this fixes your problem.