API & MCP

Everything a person can do on Ohmforge Microcontroller Timing Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Ohmforge Microcontroller Timing Calculator

Five firmware calculations with exact integer arithmetic: the UART divider (AVR UBRR normal and double speed, STM32 BRR with 16× or 8× oversampling, or any divider) with the real baud rate and error for your clock, a timer solver that finds prescaler and compare value for a target frequency or period on 8-, 16- or 32-bit timers, PWM frequency against resolution for fast and phase-correct PWM, ADC LSB size, ideal SNR and ENOB from SINAD, and RC reset or debounce times to a logic threshold.

Inputs of Ohmforge Microcontroller Timing Calculator
FieldTypeDefaultDescription
modeselect (uart, timer, pwm, adc, rc)"uart"Calculation
clockMHznumber16Clock (peripheral or timer clock)
baudnumber115200Baud rate
uartModeselect (avr, avr-u2x, stm32-16, stm32-8, generic)"avr"Baud-rate generator
oversamplinginteger16Oversampling (generic). Clock cycles per bit of a generic UART, e.g. 16 for a 16550.
fractionBitsinteger0Fractional divider bits (generic). 0 = integer divider; 4 = divider in 1/16 steps.
maxErrorPercentnumber2Accepted baud error. ±2 % is the usual design limit when both ends have their own error.
targetnumber1000Target frequency (timer, PWM) or period. Hz, or seconds when "Target is" is set to period.
targetKindselect (frequency, period)"frequency"Target is
bitsselect (8, 16, 32)"16"Timer width
prescalersselect (avr-t0-t1, avr-t2, pic-t0, stm32, custom)"avr-t0-t1"Prescaler options
customPrescalerstext"1, 8, 64, 256, 1024"My prescalers. For "My own list": whole numbers separated by commas.
pwmModeselect (fast, phase-correct)"fast"PWM mode
adcBitsinteger10ADC resolution
vrefnumber5Reference voltage
vinnumber—Input voltage to convert (optional)
sinadDbnumber—SINAD or SNR from the datasheet (optional)
rtext"10k"Resistor R. Engineering notation: 10k, 4k7, 1M.
ctext"100n"Capacitor C. 100n = 100 nF, 1u = 1 µF.
supplynumber5Supply voltage
highThresholdnumber3High input threshold. Voltage at which the input reads 1 (Schmitt trigger VT+, reset threshold).
lowThresholdnumber1.5Low input threshold (optional). Voltage at which the input reads 0 again (VT−).
targetTimetext—Delay you want (optional). For example 20m = 20 ms: the capacitor for it is computed with your R.

Example request

ATmega328P at 16 MHz: 115200 baud

curl -X POST https://ohmforgemcutiming.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"mode":"uart","clockMHz":16,"baud":115200,"uartMode":"avr","maxErrorPercent":2}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "ohmforge-mcu-timing": { "type": "http", "url": "https://ohmforgemcutiming.usefulweb.site/mcp" }
  }
}