Skip to main content
TSCOM
Associate II
August 6, 2018
Question

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

  • August 6, 2018
  • 5 replies
  • 1239 views

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.

    This topic has been closed for replies.

    5 replies

    henry.dick
    Associate II
    August 6, 2018

    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
    TSCOMAuthor
    Associate II
    August 7, 2018

    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
    Associate II
    August 7, 2018

    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.

    Tesla DeLorean
    Guru
    August 7, 2018

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    TSCOM
    TSCOMAuthor
    Associate II
    August 8, 2018

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