ESP32 UART0 and GPIO19

newmaverick
Posts: 1
Joined: Tue Jun 23, 2020 2:55 am

ESP32 UART0 and GPIO19

Postby newmaverick » Tue Jun 23, 2020 3:19 am

Hi,
I have observed a strange behaviour with UART0 when GPIO19 is configured as output. If GPIO19 is low UART0 will print and i can see data on Serial port using monitor tool, however if GPIO19 is High there is no printing on Serial port. So Serial.print(Arduino) or printf(ESP-IDF) or ESP-LOG do not print anything. I understand that GPIO19 has an alternate function as CTS for UART0(Function4) but it should be disabled once GPIO19 is configured as OutPut(Function1). Please note that GPIO19 works fine as Output pin, its just that its status interferes with UART0 transmitter. Below is a sample Arduino code which would not print the output from second for loop(number 11 - 19).
I have observed similar behaviour using ESP-IDF. Checked status of UART_CTSN bit in UART_STATUS_REG(0) and its always 0 regardless of GPIO 19 status. Also tried it on two different ESP32 Wroom boards with similar results.
Has any one experienced this behaviour? Any way to disable the UART0 CTS logic from GPIO19 Output state.

Code: Select all

void setup() {
    Serial.begin(115200);
    pinMode(19,OUTPUT);
  
}

void loop() {
  digitalWrite(19,LOW);
  for (int x =0; x<10;x++) {
  Serial.print("Value is:");
  Serial.println(x);
  vTaskDelay(500 / portTICK_PERIOD_MS);
  }
  digitalWrite(19,HIGH);
  for (int x =11; x<20;x++) {
  Serial.print("Value is:");
  Serial.println(x);
  vTaskDelay(500 / portTICK_PERIOD_MS);
  }
}

Who is online

Users browsing this forum: p-rimes and 22 guests