Skip to main content
Graduate
June 29, 2024
Solved

stm32f429 tim8 in up count mode, update interrupt couldn't generate 10Mhz PWM.

  • June 29, 2024
  • 1 reply
  • 849 views

stm32f429 ran in PCLK2 with 160MHz, and TIM8 prescaler division set to 0, auto reload set to 1.set up interrupt enable.

in TIM8 update interrupt handler, just toggle PD4 pin out.

when use oscilloscope to check the wave of PD4, just get around 2.3MHz. Can TIM8 generate 10MHz PWM with PD4 ?

    This topic has been closed for replies.
    Best answer by Michal Dudka

    MCU is overloaded by interrupts. Be aware that entering and exiting interrupt routine take some time as well as your code inside. Generaly you should not call more then about 100k ISR per second (and even that depends on how long the ISR is).
    You should use "hardware" PWM (using timer outputs). 

    1 reply

    Graduate II
    June 29, 2024

    MCU is overloaded by interrupts. Be aware that entering and exiting interrupt routine take some time as well as your code inside. Generaly you should not call more then about 100k ISR per second (and even that depends on how long the ISR is).
    You should use "hardware" PWM (using timer outputs). 

    Graduate
    July 1, 2024

    I'm sorry reply so late. I wonder can PD4 associate with a PWM output?I just see PD4 alternate function as:

    shengyang_0-1719796602088.png