cancel
Showing results for 
Search instead for 
Did you mean: 

Generating 4 pulses with different frequencies using only one STM32-Timer (4 channel PFM)

RA
Associate II

Hi,

the goal is to generate 4 pulses with a constant on time duration followed by 4 different but variable off times, i.e. a 4 channel pulse frequency modulation with one timer. The on time shall be identical on all channels, but the off times shall be different from channel to channel and shall be a multiple of the on time.

In an existing hardware design the 4 timer compare channel outputs of TIM3 are OR-ed together and the output of the OR is connected to TIM3_ETR input. The old design worked and shall now be ported to another new hardware but the original developper is not available any more.

Any ideas on how one could program TIM3 and its 4 compare channels to generate 4 different pulse frequency modulations?

Thanks!

Regards Roland

10 REPLIES 10

I totally agree it's better to change the MPU than doing tricky stuff which will have some limitations and take a lot of time to optimize and to get working.

The 32F373 would be a good alternative. Beside that I am looking in parallel into the STM32F407 in a BGA housing which has only a moderate cost increase compared to the 303. I've implemented a working solution with 65 kHz interrupt rate (only one timer) which supports 10 motors without any compromise regarding the ramps. The only drawback is the lower maximum step frequency resulting in a lower microstep setting. This seems not to be noticable in the practical application, however more tests will be needed.

Thanks al lot to you an Clive for the fruitful discussions and propoals!

Roland