← index #5373Issue #6681
Related · high · value 1.878
QUERY · ISSUE

NRF51822 - is I2C working?

openby bgolabopened 2019-12-03updated 2019-12-04
port-nrf

Hi,
Just flashed the MicroPython on PCA10028 compatible board.
I tested this board using C and I2C works fine.
Also tested the I2C module on another board (STM32) with success

When I try the I2C it fails:

from machine import I2C, Pin
i2c=I2C(-1, scl=Pin(1), sda=Pin(0))
i2c.scan()
[]

from machine import I2C, Pin
i2c=I2C(0, scl=Pin(1), sda=Pin(0))
i2c.scan()
[9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 83, 84, 85, 86, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119]

So I wonder if someone tested the I2C on NRF51 board.
When use

CANDIDATE · 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

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