How to achieve exact SCL clock timings for I2C master in transmit mode?
According to RM, "The I2C detects its own SCL low level after a tSYNC1 delay depending on the SCL falling edge", and
i2sT=1/i2sclk
tSCL=tSYNC1+tSYNC2+((SCLH+1)+(SCLL+1))*(PRESC+1)*i2sT
fSCL=1/tSCL
I tried different PLL clock configurations and altered automatically generated STM32Cube values in I2C_TIMINGR register, but was not able to achieve exact values. For example, 100kHz STM32Cube settings resulted in actual SCL value around 96kHz.
Also description states that "I2C detects its own SCL low level", does it mean that SCL clock may differ from board to board depending on I2C pullup resistor tolerances? I've tried to use I2C_NOSTRETCH_ENABLE, but it does not have effect on this issue. Maybe generate SCL clock with exact timings, for example using PWM on SCL line and using transmitter in slave mode and emulate master mode? Or emulate additional slave on the line and use it to stretch slightly higher clock of 101kHz down to 100kHz? For my application driving external DAC over I2C interface require more precise timing.