cancel
Showing results for 
Search instead for 
Did you mean: 

Possibility of measuring/generating PWMs (other than TIMs, LPTIMs and HRTIM)

TSCOM
Associate II

Hi,

I am working on STM32H743. Our application needs the following

1. At least 10 PWM outputs with independant frequencies

2. At least 10 PWM inputs with independant frequencies

The frequencies can go upto 100s of kHz

Looking at STM32H743 spec, it provides the following peripherals for dealing with this need.

1. TIM1, TIM2, TIM3, TIM4, TIM5, TIM8, TIM12, TIM13, TIM14, TIM15, TIM16 

    => 11 independant frequencies possible with these channels

2. LPTIM1...5  

    => 5 independant frequencies(only PWM outs) possible with LPTIMs

3. HRTIM

    => 5 or 6 independant frequencies possible with HRTIM

However, a lot or these pins are not available due to pin conflicts (primarily due to USB and ethernet). So I am still short of about 3 or 4 PWMs (in or out). Is there any other way to generate or measure PWMs in STM32H7?. Appreciate any support or guidance on this topic.

Note: I may be able to spare 2 or 3 DMAs(from DMA1 & DMA2), but the rest are used up. Also don't want to flood the system with interrupts.

5 REPLIES 5
henry.dick
Senior II

It is odd to need independent frequencies for pwm.

Unused output compares can be made as timers for pwm generation.

For systick for that matter.

Pwm measurement can be done with external interrupt plus a time base.​

TSCOM
Associate II

Well, the frequency is too high for using interrupts. Say @200 kHz, we will be interrupting the CPU every 5 microseconds taking away most of the CPU power.

I was hoping for some other design solution (other than what I already mentioned in the original question)

henry.dick
Senior II

if you cannot have a hardware solution and you don't want a software solution, then you don't have a solution (with MCUs). it is that simple.

maybe you can think of a hardwired logic solution, or FPGA.

Would agree that CPLD/FPGA approach to do measurement, generation and decimation, seems to be the most effective/scalable solution.

What's the driver to use the H7 over some of other F7 parts? If you can off-load busy work to a hardware/logic unit can you use something running at 200 MHz rather than 400 MHz?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TSCOM
Associate II

Thank you for the responses. Shall look into the other possibilities as you mentioned.