Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
-
- Posts: 1
- Joined: Mon Sep 12, 2016 7:57 am
Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
In hardware specification its given that there are 2 hardware I2C and even in memory map its given like i2c0 and i2c1, but in SoC i have not seen any dedicated pin. and in SDK example also no clues about I2C .please clarify this issue.
-
- Posts: 9833
- Joined: Thu Nov 26, 2015 4:08 am
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Yes, the digital portion has two hardware I2C modules. You don't see the pins for it in the pinout because they're conencted to the GPIO mux and you can connect them to any of the (output-capable) GPIOs.
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Hi,
I am working on ESP32 chip and have one requirement to connect temperature sensor over I2C Interface. I have also checked into ESP32 Data-sheet and found that there are 2 dedicated I2C interface which can be used for sensor based products.
I have checked ESP32 pin configurations and not found any dedicated pin like I2C or SDA or SCL line for I2C Interface but I have checked technical reference document and found that it is padding with Touch Sensor but not found exact pin number for that and how to use that pin with configurations.
I am working on ESP32 chip and have one requirement to connect temperature sensor over I2C Interface. I have also checked into ESP32 Data-sheet and found that there are 2 dedicated I2C interface which can be used for sensor based products.
I have checked ESP32 pin configurations and not found any dedicated pin like I2C or SDA or SCL line for I2C Interface but I have checked technical reference document and found that it is padding with Touch Sensor but not found exact pin number for that and how to use that pin with configurations.
Please help me to select I2C Pin for ESP32 based chip and how to configure it if it is interfaced with Touch Sensor and RTC.RTCIO_SAR_I2C_SDA_SEL Selects a different pad as the RTC I2C SDA signal. 0: use pad
TOUCH_PAD[1]; 1: use pad TOUCH_PAD[3]. (R/W)
RTCIO_SAR_I2C_SCL_SEL Selects a different pad as the RTC I2C SCL signal. 0: use pad
TOUCH_PAD[1]; 1: use pad TOUCH_PAD[3]. (R/W)
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Hi,
Does anyone has any information for previous question which I have asked?
Does anyone has any information for previous question which I have asked?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
There is a great post on the roadmap of the ESP32 that can be found here:
http://esp32.com/viewtopic.php?f=10&t=375
What you will find is that the current drivers for the ESP-IDF framework are far from complete. The plan by Espressif is to try and make those available by the 1st of December which is only a couple of weeks away. Included in the list of things still to be done by that date are I2C drivers. When the drivers are available, at that time we will be able to start building good samples. In the interim, you might want to look at the ESP32 Arduino project. This claims support for I2C on ESP32 today.
http://esp32.com/viewtopic.php?f=10&t=375
What you will find is that the current drivers for the ESP-IDF framework are far from complete. The plan by Espressif is to try and make those available by the 1st of December which is only a couple of weeks away. Included in the list of things still to be done by that date are I2C drivers. When the drivers are available, at that time we will be able to start building good samples. In the interim, you might want to look at the ESP32 Arduino project. This claims support for I2C on ESP32 today.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
- martinayotte
- Posts: 141
- Joined: Fri Nov 13, 2015 4:27 pm
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
You probably means "couple of days" ...1st of December which is only a couple of weeks away
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Hi,kolban wrote:There is a great post on the roadmap of the ESP32 that can be found here:
http://esp32.com/viewtopic.php?f=10&t=375
What you will find is that the current drivers for the ESP-IDF framework are far from complete. The plan by Espressif is to try and make those available by the 1st of December which is only a couple of weeks away. Included in the list of things still to be done by that date are I2C drivers. When the drivers are available, at that time we will be able to start building good samples. In the interim, you might want to look at the ESP32 Arduino project. This claims support for I2C on ESP32 today.
Thanks for Reply.
So, Are you sure that Espressif will release ESP32-IDF on 1st December with all features mentioned in release note?
If yes then it will be good for us but till that time we need to wait for that as we require it as quickly as possible.
Also, I have asked one more question regarding pin connection for I2C0 SDA and SCL line for ESP32 chip. I have checked data sheet of ESP32 but not found exact location of pin where I need to connect I2C based lines. I just found that those are shared with RTC and Touch Sensors.
Please help me on this as well if anyone has more idea about this.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Did you read about gpio matrix? Means signals can be on (almost) ANY free pin.
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Probably not *all* the features, but most of them.
Regarding I2C: it is mentioned in the technical reference manual that I2C peripheral is connected to the GPIO mux. So you can route sda and scl pins to any GPIO (which can be output and which is in the correct power domain). Please check the technical reference manual...
For code samples, don't forget to check arduino-esp32 project, in particular various "hal" files. I2C implantation is among them.
Regarding I2C: it is mentioned in the technical reference manual that I2C peripheral is connected to the GPIO mux. So you can route sda and scl pins to any GPIO (which can be output and which is in the correct power domain). Please check the technical reference manual...
For code samples, don't forget to check arduino-esp32 project, in particular various "hal" files. I2C implantation is among them.
Re: Does the Esp32 support hardware based I2C or software bit-bang based I2C ?
Hi,
Thanks for Reply.
But, I have checked esp32-hal-i2c.c file and found following 2 macros defined which is mapped directly with GPIO mux.
So, on which IO I need to connect SDA and SCL pin if there is plan to use either I2C0 or I2C1?
Please let me know your feedback or reply if you have any idea for this ASAP.
Thanks for Reply.
But, I have checked esp32-hal-i2c.c file and found following 2 macros defined which is mapped directly with GPIO mux.
So, I have one doubt that here we just need to select that either we can use I2C0 or I2C1 as per argument provided as input parameter. There is no any specific GPIO we need to define for SDA and SCL Line.#define I2C_SCL_IDX(p) ((p==0)?I2CEXT0_SCL_OUT_IDX:((p==1)?I2CEXT1_SCL_OUT_IDX:0))
#define I2C_SDA_IDX(p) ((p==0)?I2CEXT0_SDA_OUT_IDX:((p==1)?I2CEXT1_SDA_OUT_IDX:0))
So, on which IO I need to connect SDA and SCL pin if there is plan to use either I2C0 or I2C1?
Please let me know your feedback or reply if you have any idea for this ASAP.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: No registered users and 118 guests