Page 1 of 1

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

Posted: Thu Sep 22, 2016 7:06 pm
by capucsc
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?

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

Posted: Thu Sep 22, 2016 7:51 pm
by capucsc
I should also share code version info:

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

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

Posted: Thu Sep 22, 2016 8:14 pm
by dhylands
Weird.

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

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

Posted: Thu Sep 22, 2016 8:58 pm
by deshipu
Do you have any idea about what is different in the devices you don't see?

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

Posted: Fri Sep 23, 2016 2:40 am
by capucsc
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.

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

Posted: Fri Sep 23, 2016 3:42 am
by dhylands
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.