Skip to main content
Visitor II
January 9, 2018
Question

Problems in setting the duty cycle and frequency

  • January 9, 2018
  • 0 replies
  • 594 views
Posted on January 09, 2018 at 08:25

Hello community,

i got a problem when i want to create on my stm8 eval board a pwm signal with 350khz and variable duty cycle from 0-100.

i calculate the the values for the registers as follows:

PWM Frequency = Clock of the Timer without Prescaler (16Mhz) / ARR +1 --> i choosed for arr 44 so i get apprx. 355kHz

But know i can not achieve the desired pwm resolution of 100, now i have 45 steps instead of 100.

Did you guys know how to solve this problem?

Thanks a lot

    This topic has been closed for replies.