I2C - Bus master clock stretching

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
michap
Posts: 296
Joined: 26 Mar 2013 10:35
Contact:

I2C - Bus master clock stretching

Post by michap » 21 May 2018 11:18

Hi,

can somebody tell me for Z-Uno I2C - Bus master clock stretching is supported?

Wire.setClockStretchLimit(1000); give me an error
"error: no member named 'setClockStretchLimit'"

Description about this clock stretching you can read here:
https://www.i2c-bus.org/i2c-primer/cloc ... bitration/

If not supported - is there a way to set this limit to 1 ms ?
(for ESP8266 as sample it is defined by default as 230us see
https://github.com/esp8266/Arduino/blob ... si2c.c#L74 )

I want to create library for AMS IAQ-Core (Indoor Air Quality Sensor Module) - here clock streching is required.
Want to be sure that the required value is available.

Thanks!
Michael

p0lyg0n1
Posts: 128
Joined: 04 Aug 2016 07:14

Re: I2C - Bus master clock stretching

Post by p0lyg0n1 » 23 May 2018 08:58

Hi,
Z-Uno has software implementation of I2C and It able to be a master only. I don't think that you have some problems with clock stretching in this case. Could you send me the datasheet for your sensor?

michap
Posts: 296
Joined: 26 Mar 2013 10:35
Contact:

Re: I2C - Bus master clock stretching

Post by michap » 23 May 2018 09:50

Hi,

https://ams.com/documents/20143/36005/i ... deaf0a24a0

At page 4 you can see:
Although the module could send the bytes of data at a fast rate, it could happen that the module is busy at the request time. It can then hold the clock line low after reception and acknowledgement of a byte to force the master into a wait state until the iAQ-Core module is ready for the next byte transfer in a type of handshake procedure.
I had to set the time for ESP to 1000us (it has also a software implemetation of I2C as far as I know ...)

[Can just not test with Z-uno because a long time test is running with sensor on ESP, but want to be ready to make the lib ;) ]

Thanks!

Michael

Post Reply