UART
Universal Asynchronous Receiver-Transmitter
UART Block Diagram
The UART runs from the Pi Pico "UART1" port.
The buffers are not gated. They are always on.
Programmable baud rate, data bits, parity and stop bits.
Easy Write / Read table to quickly input data.
3.3V driver with 91 ohms in series, and 3.3V receivers with 1 Mohm pulldown.
The Pi Pico is the "host" and your Device Under Test (DUT) is the "peripheral".
So the host's TXD output goes to the DUT's RXD input,
and the host's RXD input on the connector is the DUT's TXD output.
GUI (Graphical User Interface):
In this example, TXD and RXD were externally connected together.
Using the "W/R" pulldown menu in the first column, select "Write".
In columns 1 and 2 of Row 1, enter the hex data bytes to be written.
Select "Read" in the first column of Row 2.
Set the spin-box "# Read Bytes" to "2" to read two bytes of data.
Press the "Run" button.
Row 1 will write the 2 bytes, then Row 2 will read them.
API (Application Programming Interface):
C API:
void init_UART(int baudrate, int data_bits, int stop_bits, int parity);
void write_TXD(int *write_data);
void read_RXD(int num_read_bytes, int *rd_buf);
PYTHON API:
init_uart(baudrate, data_bits, stop_bits, parity)
write_txd(write_data)
read_rxd(num_read_bytes)