Page 1 of 1

esp32c3: Access type of UART_FIFO_REG, and how to write into UART TX FIFO

Posted: Tue Dec 10, 2024 11:49 am
by zzy228
In esp32c3 technical reference 26.4.2, there is:
UARTn can access FIFO via register UART_FIFO_REG. You can put data into TX FIFO by writing UART_RXFIFO_RD_BYTE, and get data in RX FIFO by reading UART_RXFIFO_RD_BYTE.
If I get it right, it means that reading the lower 8 bits of UART_FIFO_REG will read one byte from RX FIFO, and writing one byte into UART_FIFO_REG will transmit one byte.
However, in 26.6 Register Summary, the access type of UART_FIFO_REG is read-only. Does this contradicts with the previous quote?
I tried reading UART_FIFO_REG and it works as expected. However, when writing bytes into UART_FIFO_REG, nothing is sent. I haven't touched any configuration register of UART after powering up.
Thank you.

Re: esp32c3: Access type of UART_FIFO_REG, and how to write into UART TX FIFO

Posted: Thu Jan 09, 2025 10:47 pm
by zzy228
I have figured it out later. UARTx_FIFO_REG has to be written into using sw instruction instead of sb