NRF51822 - is I2C working?
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
nRF52: a new I2C instance does not deinit the previous
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