I2C not working #16078
Unanswered
rbianchi99
asked this question in
STM32 / Pyboard
I2C not working
#16078
Replies: 3 comments 4 replies
-
I2C requires pullup resistors on both lines. It's possible that the board has these, but if not you need to provide them. Between 1KΩ and 10KΩ, to 3.3V. Re posting code, please read this. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Here you go. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Usually microcontrollers could map GPIOs to different Hardware-Implementations like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am stuck.
I'm working with a Nucleo F401RE board from STM. I use Windows.
I correctly installed micropython on the board, and it works fine, connecting to the repl with mpremote.
I'm trying to connect a Sensirion SDP33 to the board, but when I go and try to initialize a I2C connection, it doesn't work.
I have connected the power supply cables to the 3v3 and GND on the board, in the Arduino connectors.
Then i have connected to the PB6 and PB7 pins for the SCL and SDA to the corresponding cables, since STM32X shows them as default pins for the first I2C line.
I haven't programmed the board to have them as set for I2C using STM32X and STMCubeIDE, because if I do that and than try and add the hex file to the board, Micropython stops working. It still boots and gets me to the REPL, but it doesn't let me write anything, it just stays stuck there.
I'm not using any additional software, like Teraterm or Putty, because I need for this to work using only micropython, so i use mprmemote, which works fine if i don't try and fuck up anything.
So, i tried just using micropython and putting the following code in (Each command is of course on its own line, idk how to break line on this website, I'm very much inexperienced) :
from machine import Pin from machine import I2C i2c=I2C(scl=Pin('PB6'), sda=Pin('PB7') ) i2c.scan()
I get [], which means that the connection is not estabilished.
I checked the cables and they work. I can't check the power supply from the arduino, but the pin on the same line gives out the voltage just fine, so it should be ok.
I have no idea of what I'm failing at.
Beta Was this translation helpful? Give feedback.
All reactions