I have been learning about the different communication protocols used between Arduino and other components/sensors, namely, SPI, UART and I2C. I want to add Wi-Fi to my Arduino UNO project using ESP8266 (for now, and maybe later upgrade to an ESP32 as it's more powerful).
But i am wondering why in all the schematics that i have seen in my online research, the Arduino is always connected to the ESP8266 module via UART? Why not use SPI or I2C? Why is UART (apparently) considered superior for ESP communication with the Arduino over the two other communication protocols?
Thanks in advance for the help.
ESP8266 can never be a compliant I2C slave; there is no hardware support, and a bit-by-bit software solution isn't going to be fast enough for the standard I2C speed of 100kHz because 1) the interrupt won't arrive fast thought and 2) the GPIO bus clock is slower than 100kHz. That's why this solution can handle 14kHz max, which is useless since most other devices run at 100kHz. Try ESP32, it has I2C hardware.
\$\endgroup\$