hardwire i2c hotplugging

Working libraries, libraries being ported and related hardware
Post Reply
arpruss
Posts: 96
Joined: Sat Sep 30, 2017 3:34 am

hardwire i2c hotplugging

Post by arpruss » Thu Oct 12, 2017 2:22 am

I've been wanting to use hardwire i2c with a device -- Wii Nunchuck -- that I want to be able to plug and unplug while the stm32f103 is running. No luck. It works fine if the device is plugged in permanent, but if I unplug, I get a hang. It works perfectly with the bit-banged i2c. Any suggestions?

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: hardwire i2c hotplugging

Post by RogerClark » Thu Oct 12, 2017 5:47 am

Any idea which end is hanging

Did you try removing the battery from Nunchuck and re-inserting it, before you tried to plug it back into the STM32

Did you disconnect the Numchuck from the STM32 half way though a data transfer etc ??

racemaniac
Posts: 620
Joined: Sat Nov 07, 2015 9:09 am

Re: hardwire i2c hotplugging

Post by racemaniac » Thu Oct 12, 2017 6:41 am

probably the i2c port getting into an error state, and then hanging until you reset it.
have a look at the registers of the i2c port, see which ones you have to read to determine error states :)

arpruss
Posts: 96
Joined: Sat Sep 30, 2017 3:34 am

Re: hardwire i2c hotplugging

Post by arpruss » Thu Oct 12, 2017 12:47 pm

The Nunchuck draws power from the the connection, so when I unplug it, it gets unpowered and hence reset.

Post Reply