2020-09-30 6:52 PM
I'm guessing using the PWM (with fixed duty cycle) would be the best approach. That is, on each of the 8 pins be able to specify a period, duty cycle and number of cycles. I'm not sure how to stop the PWM after a specified number of cycles.
2020-09-30 8:47 PM
There's not going to be a super easy way to do this for 8 different channels. The best way will depend on the details of what you want. 8 pulses? 1000000 pulses? 1Hz? 1MHz? Duty cycle range?
Some options are using DMA to shift out to GPIO->BSRR to change.
Another option is just using 8 different timers to generate the PWM and manually check for the end of them and stop the timer. This is going to be more flexible.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.