> On May 31, 2018, at 6:14 PM, Brad Spencer <[email protected]> wrote:
> 
> Unfortunate behavior.  Looking back over the sensor driver I worked on,
> it appears that I always read something to determine if the device was
> actually there.


I spent some time reviewing NXP’s i2c spec this evening (well, during timeouts, 
etc. — GO DUBS), and I’m becoming convinced that there is a subtle error in our 
i2c_bitbang code… the spec seems pretty clear that a START-address-ACK should 
occur if a device is really there, and thus the “quick read” method for device 
detection should work 100% of the time.  I suspect we’re not properly setting 
the SDA line as an input at the critical time… we should be ensuring that any 
internal pull-up is activated so that any responding slave really does have to 
drive the line low, so that we can get a clear reading on the ACK.  I might 
experiment with this using an external pull-up to see if the ghosting behavior 
goes away with the “quick read”.

(Not sure I'll get to it this weekend, though… despite my kid’s spring soccer 
season being finished, I seem to have a full calendar nonetheless…)

-- thorpej

Reply via email to