← index #6681Issue #4574
Related · high · value 0.806
QUERY · ISSUE

nRF52: a new I2C instance does not deinit the previous

openby mcauseropened 2020-12-07updated 2024-09-13
port-nrf

Came across this issue when testing the nrf port on an eByte E73-TBB (nRF52832).

If you construct an I2C instance eg.
i2c = I2C(0, scl=Pin(4), sda=Pin(3))

Then reconstruct with different pins:
i2c = I2C(0, scl=Pin(3), sda=Pin(4))

The new i2c instance is still configured with previous pins.

If you soft reboot and construct a new i2c instance with any pins, it still keeps using the first pins you defined.

A hard reboot is the only way to reset it.

Related forum topic:
https://forum.micropython.org/viewtopic.php?f=12&t=9400

CANDIDATE · ISSUE

NRF port - I2C

closedby noblerabbitopened 2019-03-04updated 2019-03-14

Hi,

Did anyone test I2C on the NRF port?

I am using NRF52 DK. I connect the SDA and SCL to 26 and 27 pin on the board.

When I run i2c.scan(), I get [] - an empty list. If I connect the same sensor to esp32 (also running micropython), i2c works as it is supposed to, and I can communicate with the sensor.

Is there anything else I should set on NRF52 DK, besides just connecting the SDA, SCL, and GND and VDD from the sensor to the board; and assigning sda and scl pins through machine.i2c?

>>> import machine
>>> i2c = machine.I2C(scl=machine.Pin(27), sda=machine.Pin(26))
>>> i2c.scan()
[]
>>>

I am running MicroPython v1.10-150-gf8f272429 on 2019-03-03; PCA10056 with NRF52840.

Thanks!

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied