Page 1 of 1

unexpected pulse on GPIO pins configured as UART?

Posted: Sat May 13, 2017 10:23 am
by blavoie
I've configured UART2 to use GPIO pins 12-TX 13-RX and the UART functions seem to be working, but the performance is slower than expected. I decided to put a scope on the UART2 RX and TX pins and I noticed an expected pulse with no transactions to the UART? I'm not reading or writing anything to the UART so I was expecting the pins to remain idle. I'm noticing the same behavior on UART1 which is using pins 4-tx 5-rx. I can't understand where the pulses are coming from, but I've attached an image of the scope trace hoping someone could help explain what's going on.

Below is the example of the UART2 driver, UART1 driver is done the same way with a queue.

int uart2_init(void)
{
int uart_num = UART_NUM_2;
uart_config_t uart_config = {
.baud_rate = 115200,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.rx_flow_ctrl_thresh = 122,
};
//Set UART parameters
uart_param_config(uart_num, &uart_config);
//Set UART log level
esp_log_level_set(TAG, ESP_LOG_INFO);
//Install UART driver, and get the queue.
uart_driver_install(uart_num, BUF_SIZE * 2, BUF_SIZE * 2, 10, &uart2_queue, 0);
//Set UART pins
uart_set_pin(uart_num, (12), (13), (14), (15));

return uart_num;
}