-->
Page 1 of 1

I2C master - how fast is it?

PostPosted: Mon Nov 16, 2015 4:30 pm
by Atlantis
How fast is I2C bus implementation for ESP8266?
Is it 400kHz or rather 100kHz? I ask, because I have some problem with PCF8574 port expanders, although DS3231 RTC is working fine. RTC is designed for 400kHz, expanders support only 100kHz.
I see I2C master library is a software implementation of this bus, utilizing bit banging.
Is it possible to set frequency manually?

Re: I2C master - how fast is it?

PostPosted: Mon Nov 16, 2015 4:57 pm
by kolban
Looking at the code, it seems to be just as you said ... it sets some bits, waits 2-5 micro seconds and then sets the next bits. There doesn't appear to be any "real-time" clock synchronization going on at all. Looking at the function "writeByte", I seem to see that there is an explicit 7 microseconds ( + data shifts + GPIO outputs) per bit ... which gives me about 100Khz - 140KHz ... it certainly won't be higher than 140KHz with explicit 7 microsecond "time to write a bit".

I had no problems with the PCF8574 ... see viewtopic.php?f=15&t=4447