cancel
Showing results for 
Search instead for 
Did you mean: 

On 8 separate pins, generate autonomous pulses

GRoss.5
Associate II

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.

1 REPLY 1
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".