Quantcast
Viewing all articles
Browse latest Browse all 4856

MicroPython • Re: Pico requested vs measured I2C SCL frequency

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)

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
Image may be NSFW.
Clik here to view.
Screenshot from 2024-03-16 14-57-49.png
i2c = machine.I2C(1,sda=machine.Pin(2),scl=machine.Pin(3),freq=500000)

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
Image may be NSFW.
Clik here to view.
Screenshot from 2024-03-16 15-02-35.png
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.

Statistics: Posted by chipace — Sat Mar 16, 2024 10:11 pm



Viewing all articles
Browse latest Browse all 4856

Trending Articles