|
| 1 | +# Software UART Example (RMT backend) |
| 2 | + |
| 3 | +This example demonstrates how to simulate UART using the [soft_uart](https://components.espressif.com/component/espressif/soft_uart) component. |
| 4 | + |
| 5 | +## How to Use Example |
| 6 | + |
| 7 | +### Hardware Required |
| 8 | + |
| 9 | +* A development board with Espressif SoC |
| 10 | +* A USB cable for Power supply and programming |
| 11 | +* A UART bridge (optional, set the TX and RX pins to be the same as the loopback test if don't have) |
| 12 | + |
| 13 | +### Configure the Example |
| 14 | + |
| 15 | +Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`. Then assign the proper GPIO in the [source file](main/soft_uart_main.c). |
| 16 | + |
| 17 | +### Build and Flash |
| 18 | + |
| 19 | +Run `idf.py -p PORT build flash monitor` to build, flash and monitor the project. |
| 20 | + |
| 21 | +(To exit the serial monitor, type ``Ctrl-]``.) |
| 22 | + |
| 23 | +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. |
| 24 | + |
| 25 | +## Example Output (loopback test) |
| 26 | + |
| 27 | +```text |
| 28 | +I (248) main_task: Started on CPU0 |
| 29 | +I (248) main_task: Calling app_main() |
| 30 | +I (258) rmt-uart: new rmt uart at 0x4087cd38, baud=115200 rmt_resolution=921600 |
| 31 | +I (268) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 32 | +I (278) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 33 | +I (288) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 34 | +I (298) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 35 | +I (308) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 36 | +I (318) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 37 | +I (328) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 38 | +I (338) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 39 | +I (348) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 40 | +I (358) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 41 | +I (368) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 42 | +I (378) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 43 | +I (388) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 44 | +I (398) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 45 | +I (408) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 46 | +I (418) rmt_uart_example: Read len: 23, data: RMT UART, transmission |
| 47 | +I (478) rmt_uart_example: UART transmit 16 times! |
| 48 | +I (478) main_task: Returned from app_main() |
| 49 | +
|
| 50 | +``` |
0 commit comments