machine.I2C and pyb.I2C give very different scan results

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
capucsc
Posts: 4
Joined: Fri Nov 27, 2015 3:23 am

machine.I2C and pyb.I2C give very different scan results

Post by capucsc » Thu Sep 22, 2016 7:06 pm

I'm trying to use machine.I2C on a PyBoard, but I'm getting some interesting results when scanning the bus for devices. I have a number of devices attached. Using pyb.I2C and the default settings for I2C, I get: [39, 44, 72, 73, 90]. When I try this with machine.I2C, I only see a subset of those devices: [39, 72, 90]. Am I missing something obvious here?

capucsc
Posts: 4
Joined: Fri Nov 27, 2015 3:23 am

Re: machine.I2C and pyb.I2C give very different scan results

Post by capucsc » Thu Sep 22, 2016 7:51 pm

I should also share code version info:

MicroPython v1.8.4-40-g7ea3fa2-dirty on 2016-09-20; PYBv1.0 with STM32F405RG

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: machine.I2C and pyb.I2C give very different scan results

Post by dhylands » Thu Sep 22, 2016 8:14 pm

Weird.

It looks like machine.I2C on the pyboard is using SW I2C and pyb.I2C is using HW I2C

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: machine.I2C and pyb.I2C give very different scan results

Post by deshipu » Thu Sep 22, 2016 8:58 pm

Do you have any idea about what is different in the devices you don't see?

capucsc
Posts: 4
Joined: Fri Nov 27, 2015 3:23 am

Re: machine.I2C and pyb.I2C give very different scan results

Post by capucsc » Fri Sep 23, 2016 2:40 am

Not sure about the differences in devices. I'll need to double check data sheets about clocks and such. My next debugging steps is to break out a logic analyser to compare the two scans. I'll post again with results.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: machine.I2C and pyb.I2C give very different scan results

Post by dhylands » Fri Sep 23, 2016 3:42 am

I opened an issue in github: github.com/micropython/micropython/issues/2449

It would be good to know which ICs are the ones which are responding differently.

Post Reply