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.

[F28035] update period and duty cycle of HRPWM by CLA task

Hi all,

With regard to using HRPWM, I used CLA_task to update the duty cylce and period of HRPWM but I got some problems as following:

1. I couldn't use SFO function in CLA_task (auto-conversion is enabled), when I call this fuction there are some warnings such as #17003-D and #10015-D, and the problem not run

2. When I didn't use SFO function (auto-conversion is disabled), and I directly wrote the values of TBPRD and TBPRDHR , amd debuged result show that with constant value of PWMperiod I got an unconstant frequency.

3. When I want to multi chanels of HRPWM, if all of them are forced Sync by Software, whether this chanels are really synchronous?

Could you tell me how to use CLA_task for controlling HRPWM?

Thank you! 

  • Hi Tien,

    1. SFO library funciton should be called from CPU code. Not CLA. That could be the source of Error.
    CLA is intended to run time critical control tasks.

    2. I'm not sure I understand your question/comment. Are you seeing expected behavior? If you've programmed constant values into TBPRD/HR - you will observe corresponding PWM Frequency.

    3. Yes - you can synchronize multiple PWM channels.

    -Bharathi.
  • Dear Bharathi,

    Thank you for your answers, I saw the judiciousness on your answer by debugging my code.
    If I simultaneously update period and duty cycles of HRPWM by CLA task with SFO() fuctions just call one time in main, what will be occour? In reality, it made my applications take broken but I cannot define what wrong.
    Have any special notes when using CLA task for updating HRPWM period and duty?