Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

MicroPython • Re: Pico requested vs measured I2C SCL frequency

$
0
0
and if i then switch over to the micropython source:

Code:

        self->freq = args[ARG_freq].u_int;        i2c_init(self->i2c_inst, self->freq);        self->freq = i2c_set_baudrate(self->i2c_inst, self->freq);
it will call init, which sets the rate and returns the actual rate, which it ignores
it then immediately sets the rate again, and updates the actual rate in self->freq
but i see no way to read self->freq from python

i cant see any obvious problems in the source
so either the docs are wrong in some way, or there is an error in how youve measured the freq
or maybe clk_sys was changed after the i2c was initialized?
Thanks!
It would make sense that there would be a MicroPython method to read a physical register value... and even write to a physical register.
I will look for that function (some kind of raw memory access).
I am positive that I am measuring the SCL period correctly (positive edge -> positive edge, negative edge -> negative edge).

I believe that most users are fine with the 100kHz frequency, but I am trying to increase throughput which the slave allows.

Statistics: Posted by chipace — Sat Mar 16, 2024 5:22 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles