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.

TMS320F28388D: Questions About CLA Background Tasks and ADC Conversion

Part Number: TMS320F28388D

Tool/software:

Hello,

I have a high-priority task running on my CLA, triggered every 31.25 µs by CPU2 Timer 0. Since this task is time-critical, I want to ensure it is not delayed.

At the same time, I would like to use the CLA to handle ADC conversions whenever the high-priority task is not active. I came across background tasks, which can be interrupted by other CLA tasks, and I’m considering using them for this purpose.

I have a few questions:

  1. Is using background tasks a good approach, or would the overhead of allowing them be too significant?
  2. As I understand, Task 8 is meant to run once at startup for initialization. Would this require a while(1) loop? If so, wouldn't that be problematic since there’s no real "break" for the CLA?
  3. I don’t need ADC values very frequently—every 500 µs would be sufficient. Would you recommend continuous conversions, or would that have any downsides?
  4. Are there any considerations or potential issues when changing Task 8 from a standard task to a background task?

I appreciate your insights.

Best regards,

Wilko

  • Hi Wilko,

    The only difference between a background task and a regular task is that other tasks can be nested inside a background task. If you wanted to add a while(1) loop (as in only one trigger of the task is needed), you could, and it would run forever until another task is triggered.

    However, for your application, it sounds like you wouldn't want this. You can setup the background task to be triggered periodically (say by another CPU timer peripheral) and have each ADC reading happen inside Task 8. If a higher priority task is triggered during Task 8's execution, the CLA will context save and complete the higher priority task first.

    The overhead involved should only be the context save and restore for each nest, which should only be the saving and restoring of the current address in the MVECTBGRNDACTIVE register. I don't think this would present any major issues. 

    Best Regards,

    Delaney