FAQ: What is the default I2C bus clock speed? Can I change it to 400kHz?
Default Clock Speed: 100kHz
The hardware I2C bus on the Omega2 family has a default clock speed of 100kHz, the standard clock speed for I2C:
How is the I2C Clock Set?
The clock speed is governed by the clock divider in the I2C
The register's default value is
0x8190 800F, with
0x190set for the clock divider.
- 0x190 = 400
- The master clock is 40 MHz
- 40 MHz / 400 = 100 kHz
Changing to Fast Mode: 400kHz
It is possible to change the I2C bus clock speed to 400kHz (fast mode) by writing to the
SM0CTL0register using devmem to change the clock divider:
devmem 0x10000940 32 0x8064800F
This changes the clock divider to
0x64(100), 40MHz / 100 = 400 kHz
To optionally confirm, read the register:
devmem 0x10000940 0x8064800F
Tested on firmware v0.3.2
Check out the MT7688 SoC datasheet to see the full register definition.