I am starting to think that this is a hardware bug. Here are two sets similar register settings, but drastically different results:
i2c = machine.I2C(1,sda=machine.Pin(2),scl=machine.Pin(3),freq=520000)
i2c = machine.I2C(1,sda=machine.Pin(2),scl=machine.Pin(3),freq=500000)
It seems odd that increasing IC_FS_SCL_HCNT_1 from 96 to 100 and IC_FS_SCL_LCNT_1 from 144 to 150 would result in the SCL frequency being cut in half.
There is no errata note about i2c frequency in the datasheet.
i2c = machine.I2C(1,sda=machine.Pin(2),scl=machine.Pin(3),freq=520000)
Code:
IC_CON_0 speed is 2IC_CON_1 speed is 2IC_FS_SCL_HCNT_0 is 6IC_FS_SCL_HCNT_1 is 96IC_FS_SCL_LCNT_0 is 13IC_FS_SCL_LCNT_1 is 144
Code:
IC_CON_0 speed is 2IC_CON_1 speed is 2IC_FS_SCL_HCNT_0 is 6IC_FS_SCL_HCNT_1 is 100IC_FS_SCL_LCNT_0 is 13IC_FS_SCL_LCNT_1 is 150
There is no errata note about i2c frequency in the datasheet.
Statistics: Posted by chipace — Sat Mar 16, 2024 10:11 pm