-->
Page 1 of 2

Where are the I2C pins?

PostPosted: Mon Feb 08, 2016 6:49 am
by JohnPap70
Hello ESP community!

I was playing with an ESP8266 the ESP-07 version like the one below:
Image

Now I want to make a PCB but I can find the I2C pins!
Here https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/hardware-overview it says that the SDA is the GPIO2 and the SCL is the GPIO14.
Here https://github.com/esp8266/Arduino/blob/master/doc/reference.md it says that the SDA is the GPIO4 and SCL is the GPIO5.
And I manage to use the I2C with SDA on the GPIO5 and SCL on the GPIO4!

What is going on here? Where actually the I2C pins are located?

Re: Where are the I2C pins?

PostPosted: Mon Feb 08, 2016 7:12 am
by reaper7
SDA and SCL are declared inside pins_arduino.h (variants directory) and for generic board this is:
Code: Select allstatic const uint8_t SDA = 4;
static const uint8_t SCL = 5;


You can change it to other by this example:
Code: Select all//configure i2c
#define SDAPIN  5
#define SCLPIN  4
Wire.begin(SDAPIN, SCLPIN);          //sda, scl

or simply
Code: Select allWire.begin(5, 4);          //sda, scl

Re: Where are the I2C pins?

PostPosted: Mon Feb 08, 2016 7:41 am
by JohnPap70
But if I change it on my code, it will be again hardware I2C or something else?

Re: Where are the I2C pins?

PostPosted: Mon Feb 08, 2016 7:47 am
by reaper7
I think, that esp have only soft i2c implementation