Description
Deduplicate, select divisors with input/divisor ≤ maximumTickHz, and return the smallest eligible divisor and its tickHz.
A hardware clock divider or address offset is determined by a numeric convention and a device configuration. Calculating one candidate value does not verify register programming, electrical behavior, or timing on a particular device.
Deduplicate, select divisors with input/divisor ≤ maximumTickHz, and return the smallest eligible divisor and its tickHz.
When to use this tool
Use Watchdog Pre Scaler Setting when you need one bounded clock, divider, or address component from supplied hardware parameters.
How to use the tool and how it works
- Enter inputFrequencyHz, prescalerDivisors, maximumTickHz. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read prescaler, tickHz. Use the output convention below.
Require positive inputFrequencyHz and maximumTickHz and a nonempty list of positive integer divisors. Deduplicate, select divisors with input/divisor ≤ maximumTickHz, and return the smallest eligible divisor and its tickHz.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| inputFrequencyHz | Input Frequency Hz | Required. Finite number; strictly above 0. |
| prescalerDivisors | Prescaler Divisors | Required. Array of safe integer; maximum items 256. |
| maximumTickHz | Maximum Tick Hz | Required. Finite number; strictly above 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| prescaler | Prescaler | Required. Safe integer. |
| tickHz | Tick Hz | Required. Finite number. |
{
"input": {
"inputFrequencyHz": 32000,
"prescalerDivisors": [
1,
8,
64,
256
],
"maximumTickHz": 1000
},
"output": {
"prescaler": 64,
"tickHz": 500
}
} Limitations and assumptions
- No eligible divisor causes rejection; the returned divisor is not a register encoding and hardware availability or safe watchdog timing is not verified.
- 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 device datasheet, register layout, and measured behavior before applying the setting.
References
Similar or alternative tools
- Uart Register Divisor Byte Split
Return floor(divisor/256) as highByte and divisor modulo 256 as lowByte.
- Interrupt Vector Byte Offset
Multiply index by entry size for offsetBytes and add base for byteAddress.