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
POST https://ohmforgemcutiming.usefulweb.site/api/v1/calculate– run Ohmforge Microcontroller Timing CalculatorGET https://ohmforgemcutiming.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
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.
| Field | Type | Default | Description |
|---|---|---|---|
mode | select (uart, timer, pwm, adc, rc) | "uart" | Calculation |
clockMHz | number | 16 | Clock (peripheral or timer clock) |
baud | number | 115200 | Baud rate |
uartMode | select (avr, avr-u2x, stm32-16, stm32-8, generic) | "avr" | Baud-rate generator |
oversampling | integer | 16 | Oversampling (generic). Clock cycles per bit of a generic UART, e.g. 16 for a 16550. |
fractionBits | integer | 0 | Fractional divider bits (generic). 0 = integer divider; 4 = divider in 1/16 steps. |
maxErrorPercent | number | 2 | Accepted baud error. ±2 % is the usual design limit when both ends have their own error. |
target | number | 1000 | Target frequency (timer, PWM) or period. Hz, or seconds when "Target is" is set to period. |
targetKind | select (frequency, period) | "frequency" | Target is |
bits | select (8, 16, 32) | "16" | Timer width |
prescalers | select (avr-t0-t1, avr-t2, pic-t0, stm32, custom) | "avr-t0-t1" | Prescaler options |
customPrescalers | text | "1, 8, 64, 256, 1024" | My prescalers. For "My own list": whole numbers separated by commas. |
pwmMode | select (fast, phase-correct) | "fast" | PWM mode |
adcBits | integer | 10 | ADC resolution |
vref | number | 5 | Reference voltage |
vin | number | — | Input voltage to convert (optional) |
sinadDb | number | — | SINAD or SNR from the datasheet (optional) |
r | text | "10k" | Resistor R. Engineering notation: 10k, 4k7, 1M. |
c | text | "100n" | Capacitor C. 100n = 100 nF, 1u = 1 µF. |
supply | number | 5 | Supply voltage |
highThreshold | number | 3 | High input threshold. Voltage at which the input reads 1 (Schmitt trigger VT+, reset threshold). |
lowThreshold | number | 1.5 | Low input threshold (optional). Voltage at which the input reads 0 again (VT−). |
targetTime | text | — | 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)
- Streamable HTTP endpoint:
https://ohmforgemcutiming.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
ohmforge_mcu_timing - Local stdio connector:
node src/mcp-stdio.ts --tool=ohmforge-mcu-timing
{
"mcpServers": {
"ohmforge-mcu-timing": { "type": "http", "url": "https://ohmforgemcutiming.usefulweb.site/mcp" }
}
}