Quantcast
Viewing all articles
Browse latest Browse all 4930

SDK • Re: I2C random timeouts using i2c_write_timeout_us()

Thank you for pointing out some pieces that are quite necessary. I will try list the relevant ones.

- On the other end is a smart battery using SMBus v1.1 and the reason for speed around 20kHz.

- Tests have been done at speeds between 10kHz up to 80kHz (10kHz incr). All resulting in same behaviour described in initial post.

- Everything sits on a machine assembled circuit board.

- Trace length between RP2040-pins and spring connector for battery is < 40mm with no additional cables or connectors.

- Pull-ups are per SMBus v1.1 spec and at 3.3V I'm using 13k for a sink current around 250uA. Resistors located at spring connectors.

- Rise time according to spec should be 1us while my circuit board (with battery attached) lands at 1.1 sometimes 1.2us.

- Voltages from battery and the 3.3V feeding RP2040 have been verified Ok when a time-out occurs.

Now I do see that the internal pull-ups are being enabled upon i2c init during power-on. And that does make me question if below code would be considered a correct setup procedure for the i2c module?

Code:

i2c_init( i2c1, 20000 ); // hw module 1 at 20kHzgpio_set_function( 10, GPIO_FUNC_I2C ); // sdagpio_set_function( 11, GPIO_FUNC_I2C ); // sclgpio_pull_up( 10 ); //sdagpio_pull_up( 11 ); // scl
I will run a few tests however with internal pull-ups disabled and see how that fares.

Statistics: Posted by rhaa — Fri Jan 10, 2025 11:43 pm



Viewing all articles
Browse latest Browse all 4930

Trending Articles