diff options
author | robert-hh <robert@hammelrath.com> | 2022-08-27 10:42:15 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-08-31 00:07:23 +1000 |
commit | 53ebbf10e56dd4cc33aec6cc6d0590c66fd1948e (patch) | |
tree | 51b2f3e82ec2f06dc8f916628a26388cf671806b /docs/library | |
parent | 31d7ab327b0da4fe7747aba5590a542b88caa123 (diff) |
docs/library/machine.I2C: Add a note about I2C pull-up resistors.
Quite regularly users complain about unexpected behavior of I2C, calling it
a bug, when in fact the trouble is caused by missing pull-up resistors. So
this commit adds a note to the documentation, in the slim hope that people
will find and read it.
Diffstat (limited to 'docs/library')
-rw-r--r-- | docs/library/machine.I2C.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/library/machine.I2C.rst b/docs/library/machine.I2C.rst index 82a88390c..2a33b1da4 100644 --- a/docs/library/machine.I2C.rst +++ b/docs/library/machine.I2C.rst @@ -20,6 +20,17 @@ Software I2C is implemented by bit-banging and can be used on any pin but is not as efficient. These classes have the same methods available and differ primarily in the way they are constructed. +.. Note:: + + The I2C bus requires pull-up circuitry on both SDA and SCL for it's operation. + Usually these are resistors in the range of 1 - 10 kOhm, connected from each SDA/SCL + to Vcc. Without these, the behaviour is undefined and may range from blocking, + unexpected watchdog reset to just wrong values. Often, this pull-up circuitry + is built-in already to the MCU board or sensor breakout boards, but there is + no rule for that. So please check in case of trouble. See also this excellent + `learning guide <https://learn.adafruit.com/working-with-i2c-devices/pull-up-resistors>`_ + by Adafruit about I2C wiring. + Example usage:: from machine import I2C |