esp32c3 can't use pin18 pin19 as i2c?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
jd3096
Posts: 13
Joined: Mon Jul 05, 2021 1:22 pm

esp32c3 can't use pin18 pin19 as i2c?

Post by jd3096 » Tue Jun 07, 2022 1:21 pm

i use the latest fireware 1.18 for esp32 c3,but i found that pin 18 19 can't be used as i2c scl sda pins
i try use pin4 pin5 or others pins ,they work normally
and i try to use arduino i2c pin 18 19 work normally,too
here is my codes:

Code: Select all

import utime
from machine import Pin, SoftI2C

i2c = SoftI2C(scl=Pin(19), sda=Pin(18))   
print(i2c.scan())
the result is []
can't found i2c address

so why can't i use pin 18 19 as i2c pins?can i solve this problem by making fireware by myself? thanks a lot!!!

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: esp32c3 can't use pin18 pin19 as i2c?

Post by tepalia02 » Mon Jul 04, 2022 10:50 am

From this thread, it looks like any pin can be configured as SCL and SDA but the method seems not to be straightforward.
https://esp32.com/viewtopic.php?t=22655

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: esp32c3 can't use pin18 pin19 as i2c?

Post by jimmo » Mon Jul 04, 2022 12:20 pm

jd3096 wrote:
Tue Jun 07, 2022 1:21 pm
i use the latest fireware 1.18 for esp32 c3,but i found that pin 18 19 can't be used as i2c scl sda pins
i try use pin4 pin5 or others pins ,they work normally
Which board firmware are you using?

Pin 18 and 19 are USB D+ and D- so this won't work on firmware that uses USB.

Post Reply