I2C Object that supports clock stretching?
Timothy D. Swieter
Posts: 1,613
I am working on a project that needs I2C with clock stretching.· I reviewed the objects in the object exchange, but I don't think any of them support clock stretching.· I tried James' object and it didn't work.· So I investigated and I don't think I see the code facility in it to support the slave holding the clock.· Is there an object that does this or do I need to code it up?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
Comments
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com·- Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto fo SunSPOT, BitScope
www.sxmicro.com - a blog·exploring the SX micro
www.tdswieter.com
I am having some trouble waking up an NXP pn532. It uses clock stretching to tell the propeller when it has awoken from its sleep mode. It is supposedly up to / over 1ms of wakeup time.
Does the clock stretching happen on the very first I2C start condition? Or after the device has recognized its own address? I am wondering if the device can even detect its own address if its oscillator has not started yet?
The pn532 documentation is a bit confusing, possibly a bad translation, but its exact words are :
Moreover, to wake up the PN532C106, the host controller must
• In I2C
Send PN532 I2C address (48h). The PN532 will stretch low the SCL line during
1 ms (can be less depending on the quartz). The host controller shall wait for the
end of the stretching.
• In HSU
Send a preamble 55 55 00 00 00 00 00 FF then Len LCS …. (I was successful in waking the chip with this serial USART interface and preamble command... but I would prefer to use i2c)
It is confusing when that 1ms clock stretching begins from this sentence.
I have tried increasing the timeout period from Timmore's code (by decreasing the I2CDelayS value) but the chip appears to be holding the clock low forever.
If the pn532 wants the address before it begins clock stretching should I be writing its address using the WriteNS() function which ignores clock stretching?
I am also not sure if the clock stretching would then start on the acknowledge bit, or the next reply byte after that.
Thank you for your time.
I am not sure if this is the I2C standard, or just how this particular chip wakes up.