I have recently acquired a 10 IOs relay module ESP32 board, and I'm trying to use it with the standard Espressif development environment.
I would have liked to have the pins descriptions for IOs, RS485, Ethernet SPI and I2C, but did not find these in the documentation. So I had to discover the pins to use, mainly from the Arduino pins_is.h file.
What I did not find in this file is I2C pins settings. I think I found them on the board : GPIO22 for SDA and GPIO1 for SCL, but this configuration is really strange as GPIO1 is also used by main ESP32 board as TxD0.
Can you please clarify ?
There is an error in the product catalog (https://www.industrialshields.com/web/content?model=ir.attachment&field=datas&id=198855&)
On page 2, it describes the ESP32 10IO product with x1 I2C ports in multiple locations. From this information, it would appear to support I2C. However, it does not fully support I2C without reducing functionality as described below:
Eliminate the USB connection, and use external power. Then the I2C port can be used by remapping the default pins, as follows:
#define I2C_SDA 1
#define I2C_SCL 22
Wire.begin(I2C_SDA, I2C_SCL); // remap I2C
Also do not use Serial.begin() it will initialize the same port as the I2C is connected!
Howe Neat, Inc.
Thanks for your answer and pin details.
I'm really disappointed by the missing I2C, because I read in the product page :
Using the I2C connection, that all the Basic Controllers family has, you can connect up to 127 modules, which means that you can have up to 2.540 Input / Ouputs in Master Slave connection.
Maybe I missed what follows : NOTE: for I2C you need to tell us that requirement..
This means you could set I2C on a board if I specify it when ordering, right ? Is there a way to exchange my board ?
What I observed on the PCB really looks like a routing mistake of an I2C pin on GPIO1 instead of GPIO21, because the other I2C standard pin is correctly routed. Can you confirm ? If so you probably can suggest a workaround to have I2C working, or a board change with an updated PCB.
The mapping between the PLC IOs pins and the ESP32 is explained in the product datasheet!
As for the settings for the Ethernet, it works using the SPI configuration. It uses the GPIO23 (MOSI), GPIO19 (MISO) and GPIO18 (SCK) for the connection. Also uses the GPIO33 for the chip_select of the Ethernet (CS). The connection between the RS485 chip and the ESP32 device works with the GPIO5 (DE), GPIO16 (RX) and the GPIO17 (TX).
Currently our 10 IOs devices do not support the I2C communication, as there is not any external pin where you can use for it.
I hope I have been helpful.
About This Community
|Asked: 1/24/21, 11:28 AM|
|Seen: 113 times|
|Last updated: 1/29/21, 10:04 PM|