1. Being influenced by this thread, I uploaded the following sketch in my ESP32 S2 Mini Board (Fig-1) with a hope that the onboard LED will be blinking at 4-sec interval and the message "Hello" will also appear on the OutputBox of the Serial Monitor 1 (SM1, Fig-2) at the same rate. The LED blinks alright; unfortunately, the message "Hello" does not appear on SM1 (Fig-2).
Fig-1:
Sketch:
#define LED 15 //onboard LED
void setup ()
{
Serial.begin (115200);
pinMode(LED, OUTPUT);
}
void loop ()
{
digitalWrite(LED, HIGH);
delay(2000);
digitalWrite(LED, LOW);
delay(2000);
Serial.println("Hello");
}
2. I started to investiage the case and then changed the Serial.print() command to Serial1.print() command to connect the UART1 Port with GPIO-1/3 (Fig-2) which are (by default) TX0/RX0 lines of UART0. Now, I can exchange message between the MCU and Serial Monitor 2 (SM2, Fig-2) via UART1 (Serial1) and NOT UART0 (Serial).
#define LED 15
void setup ()
{
Serial1.begin (115200, SERIAL_8N1, 3, 1); //Bd, Frame, RX1, TX1
pinMode(LED, OUTPUT);
}
void loop ()
{
digitalWrite(LED, HIGH);
delay(2000);
digitalWrite(LED, LOW);
delay(2000);
Serial1.println("Hello");
}
Output on SM2:
23:04:54.214 -> Hello
23:04:58.228 -> Hello
23:05:02.214 -> Hello
23:05:06.204 -> Hello
3. My tentative understandings are:
(1) As conceptually presented in Fig-2, the ESP32 S2 has a built-in USB/TTL converter to demodulate the incoming codes of the sketch, and it is permanently connected with the UART0 Module of the MCU.
(2) There is no TTL/USB converter (marked red-crossed in Fig-2) within the MCU to transfer message/data from MCU to the OutputBox of SM1.
Figure-2:
4. Would be glad to hear from the respected Forum Members.