Problem with i2c port with V2 Microbit board

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
Herve_14
Posts: 4
Joined: Tue Jan 19, 2021 8:48 pm

Problem with i2c port with V2 Microbit board

Post by Herve_14 » Wed Jan 20, 2021 5:36 pm

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.

User avatar
Roberthh
Posts: 2454
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Problem with i2c port with V2 Microbit board

Post by Roberthh » Wed Jan 20, 2021 7:37 pm

That looks like a wiring problem. Do you have pull-up resistors on SCL and SDA? Please check also cables and breadboard.

Herve_14
Posts: 4
Joined: Tue Jan 19, 2021 8:48 pm

Re: Problem with i2c port with V2 Microbit board

Post by Herve_14 » Wed Jan 20, 2021 8:19 pm

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!!

User avatar
jimmo
Posts: 2244
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Problem with i2c port with V2 Microbit board

Post by jimmo » Thu Jan 21, 2021 12:42 pm

Which pins do you have the I2C SDA & SCL connected to? Can you show the full code (including initialisation of the i2c object)

Herve_14
Posts: 4
Joined: Tue Jan 19, 2021 8:48 pm

Re: Problem with i2c port with V2 Microbit board

Post by Herve_14 » Fri Jan 22, 2021 6:44 am

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

Post Reply