Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Atlantis
#34223 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?
User avatar
By kolban
#34226 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