Clock Generation (Standard-Mode, Fast-Mode and Fast-Mode Plus)

In I2C Sm, Fm and Fm+ modes, the Host clock (SCL) frequency is determined as described in this section:

The low (TLOW) and high (THIGH) times are determined by the Baud Rate register (BAUD), while the rise (TRISE) and fall (TFALL) times are determined by the bus topology. Because of the wired-AND logic of the bus, TFALL is considered as part of TLOW. Likewise, TRISE is in a state between TLOW and THIGH until a high state is detected.

Figure 34-7. SCL Timing
The following parameters are timed using the SCL low time period TLOW. This comes from the Host Baud Rate Low bit group in the Baud Rate register (BAUD.BAUDLOW) when BAUD.BAUDLOW = 0 or the Host Baud Rate bit group in the Baud Rate register (BAUD.BAUD) determines it.
  • TLOW – Low period of SCL clock
  • TSU;STO – Setup time for stop condition
  • TBUF – Bus free time between stop and start conditions
  • THD;STA – Hold time (repeated) start condition
  • TSU;STA – Setup time for repeated start condition
  • THIGH is timed using the SCL high time count from BAUD.BAUD
  • TRISE is determined by the bus impedance; for internal pull-ups
  • TFALL is determined by the open-drain current limit and bus impedance; can typically be regarded as zero

    See Electrical Characteristics from Related Links.

The SCL frequency is given by:

fSCL=1TLOW+THIGH+TRISE

When BAUD.BAUDLOW is zero, the BAUD.BAUD value is used to time both SCL high and SCL low. In this case, the following formula gives the SCL frequency:

fSCL=fGCLK10+2BAUD+fGCLKTRISE

When BAUD.BAUDLOW is non-zero, the following formula determines the SCL frequency:

fSCL=fGCLK10+BAUD+BAUDLOW+fGCLKTRISE

The following formulas can determine the SCL TLOW and THIGH times:

TLOW=BAUDLOW+5fGCLK

THIGH=BAUD+5fGCLK

Note: The I2C standard Fm+ (Fast-mode plus) requires a nominal high to low SCL ratio of 1:2, and BAUD must be set accordingly. At a minimum, BAUD.BAUD and/or BAUD.BAUDLOW must be non-zero.
Start-up Timing: The minimum time between SDA transition and SCL rising edge is 6 APB cycles when the DATA register is written in smart mode. If a greater start-up time is required due to long rise times, the time between DATA write and IF clear must be controlled by software.
Note: When timing is controlled by the user, the Smart mode cannot be enabled.