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.

MSPM0L1306: DMA moves data to PWM duty periodically

Part Number: MSPM0L1306

Dear Champs,

I am asking this for our customer.

If the user wants to output PWM with duty 0%, 2%, 4%, 6%, ....,100%, 0%, 2%... every 10 us without CPU intervention, is it feasible to use DMA to move a table 0%, 2%, 4%, ... ,100%, 0%, 2%, 4%... to a TIMER register every 10 us (used as duty) to generate such PWM?

  • Hello Wayne,

    First question is speed:  Do they want the duty cycle updated every 10 us or go through the entire table every 10 us?  

    As for the DMA, it should definitely be able to move data from memory to the capture compare register, but they might need two timers to accomplish this without any CPU intervention.   One timer triggering the DMA every 10 us via the event subsystem to do the transfer and then one timer actually generating the PWM. 

    Hope this helps. 

    Thanks,

    JD   

  • Dear JD,

    They want the duty cycle updated every 10 us.

    I understand now.

    Thank you for your comment.

  • Hey Wayne,

    Since they will be updating the timer while it's running, it would also be best to use a timer with a shadow load register.  Shawdow Load register allows the CCx register to be updated exactly at the end of the PWM period and not randomly during the period.  It will keep the waveform smooth. 

    On MSPM0L1306, I believe only TIMG4 has shadow registers, so they should use this one for the PWM output. 

    Thanks,

    JD