Set Number of Pulses from MCPWM?
Posted: Mon Nov 20, 2017 1:07 am
Hello-
I am controlling a small stepper motor with the MCPWM module.
I need a function which will cause the PWM to emit a fixed number of pulses.
My first code uses the Capture module to count pulses, and then an if statement shuts down the PWM output when
the desired number of steps is reached. The capture module is firing an ISR at each pulse. This is creating a large number of interrupts!
I would like a way to configure the PWM to emit "n" number of pulses where n is an integer.
Hopefully this can be done such that the PWM does this autonomously without requiring many interrupts.
Your suggestions are appreciated!
Regards,
Greg
I am controlling a small stepper motor with the MCPWM module.
I need a function which will cause the PWM to emit a fixed number of pulses.
My first code uses the Capture module to count pulses, and then an if statement shuts down the PWM output when
the desired number of steps is reached. The capture module is firing an ISR at each pulse. This is creating a large number of interrupts!
I would like a way to configure the PWM to emit "n" number of pulses where n is an integer.
Hopefully this can be done such that the PWM does this autonomously without requiring many interrupts.
Your suggestions are appreciated!
Regards,
Greg