Example-8: Typical solution for exercise-2

 Using TIM4_CH1 generate a PWM in PD12 (frequency = 1Hz, Duty Cycle = 50%):

Library dependencies

  • STM32F4xx_StdPeriph_Driver
    • stm32f4xx_rcc
    • stm32f4xx_tim
    • stm32f4xx_gpio

THE END.

Sharif University of Technology, Tehran, Iran