2019-02-18 07:53 PM
I have inherited a PCBA that needs to generate a fixed number of PWM pulses on TIM2 CH4.
I have successfully setup TIM1 as the Master (with repetition count = 0) and TIM4 as a Gated Slave.
TIM1 CH1 is generating 2kHz PWM indefinitely.
TIM2 CH4 is generating 1kHz PWM indefinitely.
If repetition count is non zero, the TIM2 CH4 PWM freq decreases.
Can I configure TIM1 such that it stops after '2N' cycles and therefore TIM2 stops after 'N' cycles?
2019-02-18 10:14 PM
Which STM32? On STM32F437, one timer would probably be good enough if one of the channel is fed by cyclic DMA to provide 2 pulses at 1kHz.
2019-02-19 12:44 AM
STM32F415. Is there an example of the above?
2019-02-19 02:33 PM
> Can I configure TIM1 such that it stops after '2N' cycles
Try to set TIM1_RCR to 2N, and use one-pulse mode, ie set TIM1_CR.OPM=1.
Note, that the RCR register is 8-bit, so that maximum N is 127.
JW