Serial2 is noisy [ESP32 - Arduino]
Posted: Tue Jul 28, 2020 5:24 am
Hello everyone,
I am trying to use the Serial2 for UART communication with a Raspberry3.
But I can't communicate anything, once I connect a wire to pin 16, Serial2.available() is trigger and send me noise. Even when the wire is not even connected to anything, or I just need to touch with my finger the pin and I get noise.
Of course, I get noise even if I correctly connect the wire to the Raspberry3.
I really tried anything to get rid of the noise, but I couldn't find a solution.
So I ultimately posted my issue here.
Here is my minimal code :
I tried also this solution : https://quadmeup.com/arduino-esp32-and- ... ial-ports/
Same result, I just get noise, even if the pin is not connected.
I attached a picture of how I connect the wires.
Do someone knows what I am doing wrong ?
I am trying to use the Serial2 for UART communication with a Raspberry3.
But I can't communicate anything, once I connect a wire to pin 16, Serial2.available() is trigger and send me noise. Even when the wire is not even connected to anything, or I just need to touch with my finger the pin and I get noise.
Of course, I get noise even if I correctly connect the wire to the Raspberry3.
I really tried anything to get rid of the noise, but I couldn't find a solution.
So I ultimately posted my issue here.
Here is my minimal code :
Code: Select all
#include <Arduino.h>
#define RXD2 16
#define TXD2 17
void setup() {
Serial.begin(9600);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial.println("Serial Txd is on pin: "+String(TX));
Serial.println("Serial Rxd is on pin: "+String(RX));
}
void loop() {
while (Serial2.available()) {
Serial.print(char(Serial2.read()));
}
}
Same result, I just get noise, even if the pin is not connected.
I attached a picture of how I connect the wires.
Do someone knows what I am doing wrong ?