rogerclarkmelbourne / Arduino_STM32

Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards
Other
2.52k stars 1.26k forks source link

Arduino_STM32 I2C scanner wire not working #808

Closed Naveenkato closed 3 years ago

Naveenkato commented 4 years ago

Hy, Im using MCP23017 to expand the GPIO,But here im using Wire.h library for communicate the STM32F103C8T6 with MCP23017.When i run the the i2c scanner program,it continuously returns no device found.But the softwire library detects the device present in I2C bus.

stevstrong commented 4 years ago

Do you try to communicate on pins PB6/PB7 ? Does the module have pull-up resistors on SDA/SCL lines?

dewhisna commented 4 years ago

Possible duplicate of #799? (which I still haven't had time to look into since my lab isn't fully restored yet from the flooding)

If it is the same issue, the workaround in the meantime is to just use fixed/known device addresses and not use scanning to locate them.

stevstrong commented 4 years ago

As @dewhisna suggested, try to use the module directly, not using the scanner. Does the chip then work?

Naveenkato commented 4 years ago

Yeah, the wire library working well with known devices.

stevstrong commented 3 years ago

@Naveenkato , please test the latest version (see https://github.com/rogerclarkmelbourne/Arduino_STM32/commit/1ac0186984e38de6fe1820afaf5b27cacae56d19), there was a fix for Wire.cpp regarding the STOP condition, it might solve this issue as well.

stevstrong commented 3 years ago

No answer from OP, so I close this because it works now as expected.