Tool/software:
Hello Team,
How can I generate just one pwm pulse? Do I need to use one shot mode interrupt and trigger pwm interrupt inside?
If there's any example code, please let me know.
I think you can use example timx_timer_mode_pwm_edge_sleep:
https://dev.ti.com/tirex/explore/node?node=A__AJKqQhYQGIeFg2xNN9p1ng__MSPM0-SDK__a3PaaoK__LATEST
and add a call to
> DL_Timer_setCounterRepeatMode(PWM_0_INST, DL_TIMER_REPEAT_MODE_DISABLED);
Then each time you call DL_TimerG_startCounter() you'll get one pulse.
Thanks Bruce,
This helped me solve the problem.
Do you usually find this line from SDK/Drivelib/api_guide?
I usually start with the TRM -- in this case I knew you wanted REPEAT=0 -- then search the driverlib source [source/ti/driverlib] to see how it references the setting.
There is a mode DL_TIMER_TIMER_MODE_ONE_SHOT, but it seems to only apply to Timer-s, not to PWM-s [even though they're actually all timers]. Thus the extra required call.