Help

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

ESP32 38AR TTL Serial

Avatar
David Almenar

Thank you in advance for your help. I am trying to communicate the PLC (ESP32 38AR) to an external device using TTL. It didn't work, and I wanted to check if there was something wrong with the TTL.

With the switch in the "0 Zone" configured according to the manual: 1: OFF, 2: ON, 3:ON, 4:OFF, the PLC powered with 24V and this test code:

void setup() {
Serial.begin(9600);
Serial1.begin(115200);  
Serial2.begin(115200);  
delay(10000);
Serial.println("setupend");
}
void loop() {
Serial.println("0");
Serial1.println("1");
Serial2.println("2");
delay(5);
}

Reading voltages from the TX1 and RX1 reads ground level. Reading from TX2 is ground level too, but TX2 is 3.4V, the opposite as expected.

The same code in a standard ESP32 (Wroom) works as expected (High for TX2 and low for RX2).

I guess that I am missing something with the configuration, but I don't know what could be. I would apreciate any help.

Avatar
Discard
1 Answer
0
Best Answer

Hi David, 

There was a bug with the old versions of the industrialshields-esp32 package and the serial 1 and 2 pins were swapped. The newest version should be working fine. 

Regards.

Avatar
Discard