Description
Floor inputTicks / prescaler for counterTicks.
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.
Floor inputTicks / prescaler for counterTicks.
When to use this tool
Use Timer Prescaler Counter Bit Budget when you need a timer period, wrap delta, or explicit count-budget term.
How to use the tool and how it works
- Enter inputTicks, prescaler, bits. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read counterTicks, overflows, remainder. Use the output convention below.
Floor inputTicks / prescaler for counterTicks. Divide that count by 2^bits into overflows and remainder, with bits from 1 through 32.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| inputTicks | Input Ticks | Required. Safe integer; minimum 0. |
| prescaler | Prescaler | Required. Safe integer; minimum 1. |
| bits | Bits | Required. Safe integer; minimum 1; maximum 32. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| counterTicks | Counter Ticks | Required. Safe integer. |
| overflows | Overflows | Required. Safe integer. |
| remainder | Remainder | Required. Safe integer. |
{
"input": {
"inputTicks": 1000,
"prescaler": 4,
"bits": 8
},
"output": {
"counterTicks": 250,
"overflows": 0,
"remainder": 250
}
} Limitations and assumptions
- Discarded prescaler remainder is not returned; the model assumes a zero initial counter and simple wraparound behavior.
- 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 Capture Overflow Age Term
Add wraps × 2^bits to current - captured and require a nonnegative safe-integer elapsedTicks.
- Timer Capture Counter Wrap Delta
Compute (current - previous) modulo 2^width and mark wrapped when current is numerically smaller.