Description
Return edgeTicks as periodTicks or twice periodTicks for center alignment.
Timer formulas depend on whether endpoints are inclusive, the count direction, prescaling, and wrap behavior. A counter reading alone cannot reveal an arbitrary number of elapsed wraps.
Return edgeTicks as periodTicks or twice periodTicks for center alignment.
When to use this tool
Use PWM Edge Center Aligned Resolution when you need a timer period, wrap delta, or explicit count-budget term.
How to use the tool and how it works
- Enter periodTicks, centerAligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read edgeTicks, countStates. Use the output convention below.
Return edgeTicks as periodTicks or twice periodTicks for center alignment. Return countStates separately as periodTicks + 1.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| periodTicks | Period Ticks | Required. Safe integer; minimum 1; maximum 2147483647. |
| centerAligned | Center Aligned | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| edgeTicks | Edge Ticks | Required. Safe integer. |
| countStates | Count States | Required. Safe integer. |
{
"input": {
"periodTicks": 100,
"centerAligned": true
},
"output": {
"edgeTicks": 200,
"countStates": 101
}
} Limitations and assumptions
- These outputs follow the stated counting convention; neither is a measured waveform period or a device-specific timer guarantee.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Check the timer mode and register semantics in the device documentation, including synchronization and latency.
References
Similar or alternative tools
- Timer Up Down Counter Turnaround Period
Use 2 × top ticks for an up/down cycle and multiply by prescaler / clockHz for periodSeconds.
- Microcontroller: PWM Compare Polarity Crosswalk
Use compareTicks as activeTicks for noninverting polarity or periodTicks - compareTicks for inverting.