I2C Timing Calculator
Approximate STM32 I2C TIMINGR fields (PRESC/SCLL/SCLH/SCLDEL/SDADEL) for Standard/Fast/Fast+ modes.
TIMINGR fields
PRESC
–
SCLL
–
SCLH
–
SCLDEL
–
SDADEL
–
TIMINGR
–
Actual SCL freq
–
Actual tLOW / tHIGH
–
How it works
The STM32 I2C peripheral derives its clock timing from I2CCLK through a
prescaler and four count fields packed into TIMINGR:
tPRESC = (PRESC + 1) × tI2CCLK
The tool picks the smallest PRESC (highest resolution) for which the low and
high period counts fit in their 8-bit fields:
SCLL = round(tLOW ÷ tPRESC) − 1 SCLH = round(tHIGH ÷ tPRESC) − 1
SCLDEL and SDADEL add margin for the bus rise/fall times so data is
valid before SCL is sampled; they're derived here from the rise/fall time inputs. This is a
simplified model of the full ST timing tool (AN4235) — good for design estimates, but
double-check against CubeMX for a specific board and bus load.