esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.04k stars 13.33k forks source link

I2C speed on Nodemcu ESP8266 #4406

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi all!, I have a douby. I need to add some I/O to my Nodemcu, and I have 2 options: -PCF8574 (+8 I/O) -PCF8575 (+16 I/O)

1.- I wonder that if I need 2 bytes in order to read or write to the PCF8575, and only 1 byte to the PCF8574, means that it takes twice time in finish an order to the I2C bus? 2.- I need the maximum speed on the I2C bus. Need I set something when initialize the bus? or it works at maximum speed by default? 3.- Is the maximum speed on Nodemuc Esp8266 I2C bus 450kHz??

Thanks in advance! :)

WereCatf commented 6 years ago

1) Obviously, yes. 2) I don't know what the default is, but you can easily set it to e.g. 400KHz with Wire.setClock(400000L); 3) I've only tried it up to 400KHz, which works just fine.

If you need faster speeds than I2C offers, look into the MCP23S17 instead, which can be driven at 10MHz over SPI-bus.

devyte commented 6 years ago

Not the right place to ask these questions. Closing as off topic, see issue POLICY doc for details.