Page 1 of 1

Problem with i2c port with V2 Microbit board

Posted: Wed Jan 20, 2021 5:36 pm
by Herve_14
Hi, I have a microbit V2 board but the script that run fine with V1.5 doesn't run anymore because i have a problem w/ i2c on V2.
When i run i2c.scan() on v2 board (stand alone) i get :
>>> i2c.scan()
[9, 12, 14, 17, 19, 21, 23, 26, 28, 31, 33, 36, 38, 41, 43, 46, 49, 51, 53, 55, 57, 59, 61, 64, 66, 69, 71, 73, 75, 78, 80, 83, 85, 87, 89, 92, 94, 96, 98, 101, 104, 106, 108, 110, 112, 114, 117, 119]
and i can't write anything... (oserror 19)
How can i fix this problem???
Thanks

I have this µpython version : MicroPython v1.13 on 2020-12-21; micro:bit v2.0.0-beta.3 with nRF52833
Type "help()" for more information.

Re: Problem with i2c port with V2 Microbit board

Posted: Wed Jan 20, 2021 7:37 pm
by Roberthh
That looks like a wiring problem. Do you have pull-up resistors on SCL and SDA? Please check also cables and breadboard.

Re: Problem with i2c port with V2 Microbit board

Posted: Wed Jan 20, 2021 8:19 pm
by Herve_14
Hi, thanks for for the reply... Yes i have tested lot of configuration... alone or connected to a breaboard w/ sensor (MPU6050).. I also changed the pin and frequency ( i2c.init(100000,sda=pin14,scl=pin13) ).. every test works fine w/ the V1.5 board..
I looking for the V2 schematic to understand...
Thanks!!

Re: Problem with i2c port with V2 Microbit board

Posted: Thu Jan 21, 2021 12:42 pm
by jimmo
Which pins do you have the I2C SDA & SCL connected to? Can you show the full code (including initialisation of the i2c object)

Re: Problem with i2c port with V2 Microbit board

Posted: Fri Jan 22, 2021 6:44 am
by Herve_14
Hi Jimmo

It's better now.. i can use the i2c port w/ the default pins (19/SCL & 20/SDA) ..
unlike V1.5 board you can't use the others pins : i2c.init(400000 ,sda=pin14,scl=pin13) for example..

i2c.scan() doesn't work on V2 board, it's not a big problem.. it's just a tool .. (there is an issue on support.microbit.org)

Best Regard