← index #5373Issue #4574
Related · high · value 2.527
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

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