Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

PWM Frequency and Resolution

Relate an edge-aligned timer period to PWM duty steps.

Electronics workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulafPWM=fclock/(prescale counts)
Sources and model references

Worked example

Inputs

Timer clock
48000000 Hz
Prescaler
1
Period counts
1024
Requested duty
0.3

Expected results

PWM frequency
46875 Hz
Nearest compare count
307 counts
Actual duty
0.2998046875 fraction
Equivalent resolution
10 bits

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter the labeled inputs in the indicated units.
  2. Calculate and compare every output against the stated model assumptions.

Try this example

{
  "clock": 48000000,
  "prescale": 1,
  "counts": 1024,
  "duty": 0.3
}

Accuracy and scope

Edge-aligned ideal PWM; excludes dead time and peripheral endpoint behavior. Simplified analytical model; not a design recommendation or safety certification.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.