I've been testing the UART comms between my UNO board and ESP32. I've followed the basics of having a common ground, connecting RX pin 0 to TX2 and TX pin 1 to RX2, and using a lm1117t 3.3v as a voltage regulator to tone down the logic level.
Yet, when I connect both boards to my laptop, the ESP32 uploads the code as usual, but my UNO refuses to upload it. One thing to note is that, the UNO by itself works, but as soon as I connect the ESP32, everything stops working.
Here's the code for Arduino UNO
Serial.begin (9600);
Serial.println ("Inicio");
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available() > 0)
{
String mensaje = Serial.readStringUntil('\n');
mensaje.trim();
Serial.print("ARDUINO: ");
Serial.println(mensaje);
}
delay(1);
}
And here's the code for the ESP32
#define RXD2 16
#define TXD2 17
#define LED 2
void setup() {
// put your setup code here, to run once:
Serial.begin (19200);
Serial2.begin (9600, SERIAL_8N1, RXD2, TXD2);
pinMode (LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) {
Serial.print ("ESP32: ");
Serial.print ("Recibi el mensaje, ");
Serial.println (Serial2.readString());
digitalWrite (LED, HIGH);
delay (500);
digitalWrite (LED, LOW);
}
delay (1000);
}
This the error that shows up everytime I try to upload:
El Sketch usa 3310 bytes (10%) del espacio de almacenamiento de programa. El máximo es 32256 bytes.
Las variables Globales usan 214 bytes (10%) de la memoria dinámica, dejando 1834 bytes para las variables locales. El máximo es 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xd6
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xd6
Failed uploading: uploading error: exit status 1