sbcshop / PiSquare

PiSquare is an RP2040 and ESP-12E-based board that allows you to use multiple Raspberry Pi HATs without stacking them on top of one other. PiSquare uses Socket programming to wirelessly communicate multiple Raspberry Pi HATs ("n" numbers of HATs).
MIT License
26 stars 5 forks source link

CircuitPython and onboard OLED: pullups requested for SDA/SCL (I2C) #5

Open thymjan opened 2 years ago

thymjan commented 2 years ago

I'm running in an issue with CircuitPython: Can't use the onboard OLED-display without pullups. A similar topic was discussed here: [https://github.com/adafruit/circuitpython/pull/4488#]

SDA=board.GP6 SCL=board.GP7 i2c = busio.I2C(SLC, SDA)

Is there a way to activate the internal pullups?

dhalbert commented 2 years ago

Replied also in https://github.com/adafruit/circuitpython/pull/4488#issuecomment-1186537018. This is probably the better place for discussions on the PiSquare specifically.

The internal pullups on an RP2040 are quite weak (50k-80k) and not very good for I2C. All of the I2C breakouts Adafruit makes have on-board pullups. We don't add pullups to the microcontroller boards.

It looks like (https://cdn.shopify.com/s/files/1/1217/2104/files/Schematic_9f818051-fdfc-43dd-9e5e-0999f1dc1d1c.pdf?v=1657287360) GPIO7 and GPIO6 are used for I2C. Since those pins are available on the 2x20 header, I think you could add some external pullups from those pins to 3.3V without too much work.

It would be nice if this board had external pullups on the I2C pins. If you don't want them pulled up all the time, the pullup voltage could be supplied by another GPIO pin.

thymjan commented 2 years ago

I've already made a little shim: IMG_0230 This is working. But I don't get the point why there is no option in CircuitPython to activate the internal pullups for I2C. With MircoPython I can use the onboard display without the external pullups.