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.

CLA Call timing problem

Hi,

I'm using a F28035 piccolo mcu. I'm using the CLA task 1 configured to be triggered every 10us on PWMINT1. The PWM has a frequency of 100kHz. I was having problem with part of my code where I set one PWM state at the beginning of the CLA based on certain condition. It can run ok for 100ms sometime and other times, it caused problem. My action wasn't being done in time. I added a timer running in CPU and stamped the starting time of the CLA. If my tests are correct, sometime, the CLA isn't called every 10us. it was either called too quick or too late. I need to improve my test to give more info about that. 

Before going any further, I just wanted to confirm if this is possible. Having the CLA triggered by PWM. PWM frequency never changes. Only one task is setup in CLA. Can the task 1 be delayed by something I'm not think about?

Thanks a lot!

  • Hi Mosin,

    if you are running the 035 at 60MHz and your PWM at 100KHz, with each PWMINT triggering task1, you should have ~600 cycles or about 10.002us worth of code that you can run on task 1. As long as you dont exceed those 600 cycles, task 1 should be triggered consistently by the PWM

  • Hi Vishal,

    I did more tests. Here are my results :

    Configuration 

    ADCINT1 == SOC Sample 6

    CLA Trigger == ADCINT1

    Timer0 ISR : Called every 500us doing some stuff

    PWM1 ISR On CTR ==0 : Called every 10us doing not much

    ADC SOC : Triggered by PWM 1 on CTR == 0 every 10us

    No problem with this configuration. CLA is called every 10us. I have overflow protection so I know my code doesn't last longer than 10us.

    Other configuration

    ADCINT1 == SOC Sample 6

    CLA Trigger == PWMINT1 ( On CTR == 0 )

    Timer0 ISR : Called every 500us doing some stuff

    PWM1 ISR On CTR ==0 : Called every 10us doing not much

    ADC SOC : Triggered by PWM 1 on CTR == 0 every 10us

    When my CLA is triggered by PWMINT, it looks like having Timer 0 ISR called, possibly delaying PWM INT 1 ISR it caused spurious delays on the CLA calls triggered by PWM INT 1. 

    Is the PWM Int 1 triggering the CLA sent after my code in the PWMINT1 ISR? I don't think so... I would have way more problems than that. 

    Anyway, it's just a curiosity to find out why. My current config, with beginning of ADC conversion triggering my CLA is ok. I have more latency before my CLA is called, but that will be part of another question.

    If you have more information for me, it would be appreciated!

    Regards