8000 docs/library/machine.I2C: Add a note about I2C pull-up resistors. · lowfatcode/micropython@53ebbf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 53ebbf1

Browse files
robert-hhdpgeorge
authored andcommitted
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.
1 parent 31d7ab3 commit <
10000
span class="fgColor-default">53ebbf1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/library/machine.I2C.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ Software I2C is implemented by bit-banging and can be used on any pin but is not
2020
as efficient. These classes have the same methods available and differ primarily
2121
in the way they are constructed.
2222

23+
.. Note::
24+
25+
The I2C bus requires pull-up circuitry on both SDA and SCL for it's operation.
26+
Usually these are resistors in the range of 1 - 10 kOhm, connected from each SDA/SCL
27+
to Vcc. Without these, the behaviour is undefined and may range from blocking,
28+
unexpected watchdog reset to just wrong values. Often, this pull-up circuitry
29+
is built-in already to the MCU board or sensor breakout boards, but there is
30+
no rule for that. So please check in case of trouble. See also this excellent
31+
`learning guide <https://learn.adafruit.com/working-with-i2c-devices/pull-up-resistors>`_
32+
by Adafruit about I2C wiring.
33+
2334
Example usage::
2435

2536
from machine import I2C

0 commit comments

Comments
 (0)
0