Description
Subtract counter from reload for elapsedTicks and divide by reload + 1 for fraction.
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.
Subtract counter from reload for elapsedTicks and divide by reload + 1 for fraction.
When to use this tool
Use RTC Subsecond Downcounter Elapsed when you need a timer period, wrap delta, or explicit count-budget term.
How to use the tool and how it works
- Enter counter, reload. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read elapsedTicks, fraction. Use the output convention below.
Subtract counter from reload for elapsedTicks and divide by reload + 1 for fraction. Both are nonnegative integers with counter no greater than reload.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| counter | Counter | Required. Safe integer; minimum 0. |
| reload | Reload | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| elapsedTicks | Elapsed Ticks | Required. Safe integer. |
| fraction | Dimensionless fraction under the stated convention. | Required. Finite number. |
{
"input": {
"counter": 127,
"reload": 255
},
"output": {
"elapsedTicks": 128,
"fraction": 0.5
}
} Limitations and assumptions
- This is an inclusive-reload down-counter model; the fraction remains below one and no calendar timestamp is produced.
- 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
- Microcontroller: RTC Sub Second Register Fraction
For down counting use reload minus subsecondRegister; for up counting use the register itself.
- Microcontroller: Timer Counter Inclusive Period
Count top + 1 ticks for a counter visiting zero through top inclusively.