This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PMP23126: Alpha States and Task Scheduler

Part Number: PMP23126

Tool/software:

Hi,

At almost every digital power based example projects, there is timer based task structure like Alpha states, A branches, B branches. However, I couldn't find any documents explaining this state machine. I actually need a visualized version of this state machine with explanations. 

1) For PMP23126, can you please briefly draw state machine and show how this scheduled tasks take place as below? Visual explaination is crucial for me.

2) At PMP23126, we increaseTimer0[0] in every A0 task, but we never use this array. What does vTimer0[0]++ or vTimer1[0]++ do? What is purpose of this lines? It is never used.

3) At PMP23126, can you please briefly define the periods of Tasks?

4) At PMP23126, there is "the next time CpuTimer1 'counter' reaches Period value go to B2" comment at every task. However, B1 task is like below and there is no counter or etc. inside that function. How can it be jump to B1 when counter reaches period?

void B1(void)
{

    PSFB_UpdateOCPThreshold();

    PSFB_UpdateRampSlope();

    //
    //the next time CpuTimer1 'counter' reaches Period value go to B2
    //
    B_Task_Ptr = &B2;
}

5) At PMP23126, can you please explain if there is any disadvantages of this kind of periodic task scheduler?

6) I just look for implementing three tasks that execute every 1msec, 10msec and 100msec respectively with accurate timing. Small deviation is acceptable for me. Can you briefly guide me about it?

Thanks in advance.

  • Hi Gokhan G.

    1. Figure 8 from the software guide may be helpful for this. Please refer to below:

    /cfs-file/__key/communityserver-discussions-components-files/234/pmp23126_5F00_software_5F00_guide.pdf

    2. I believe this was used for a debugging purpose during development but was not removed when it was no longer needed.

    3. The execution rate for Task A is 2kHz, task B is 20Hz and task C is 10kHz. this is defined in the psfbpcmc_user_settings.h file. You can also take a look at the PSFB_HAL_setupDevice function within the psfbpcmc_hal.c file.

    4. I believe this was moved elsewhere in the code during a refactor but the comment never got deleted.

    5. I believe it really depends on what task you are scheduling and the update rate. You would want a protection mechanism to be checked frequently to avoid delays in shutting down for example. This comes at a tradeoff of more utilization. 

    6. I believe you can refer to the way tasks A,B,C are set up in the user_settings.h and psfbpcmc_hal.c files. You can change the execution rates in the user_settings to be 1kHz, 100Hz and 10Hz for example to achieve the timings you want.

    Best Regards,

    Ben Lough