How to avoid garbage in UART0 after restart of ESP8266?
Posted: Tue Jun 02, 2015 8:54 am
Hi.
We are using the ESP-12 and we need send data by UART0.
We are using the Unofficial Development Kit for Espressif ESP8266 (http://www.programs74.ru) and Absolutely transparent bridge for the ESP8266 (https://github.com/beckdac/ESP8266-transparent-bridge).
The problem is the garbage on start.
We are using GPIO15 to signal the beginning of the UART0.
We are using GPIO4 to signal the beginning of the uart_tx_one_char().
How to avoid garbage in UART0 after restart of ESP8266?
We are using the ESP-12 and we need send data by UART0.
We are using the Unofficial Development Kit for Espressif ESP8266 (http://www.programs74.ru) and Absolutely transparent bridge for the ESP8266 (https://github.com/beckdac/ESP8266-transparent-bridge).
The problem is the garbage on start.
We are using GPIO15 to signal the beginning of the UART0.
We are using GPIO4 to signal the beginning of the uart_tx_one_char().
Code: Select all
LOCAL STATUS
uart_tx_one_char(uint8 uart, uint8 TxChar)
{
// INTCOM em alta - envio de comando
gpio_write(GPIO_4_PIN, 1);
while (true)
{
uint32 fifo_cnt = READ_PERI_REG(UART_STATUS(uart)) & (UART_TXFIFO_CNT<<UART_TXFIFO_CNT_S);
if ((fifo_cnt >> UART_TXFIFO_CNT_S & UART_TXFIFO_CNT) < 126) {
break;
}
}
WRITE_PERI_REG(UART_FIFO(uart) , TxChar);
return OK;
}
How to avoid garbage in UART0 after restart of ESP8266?