Skip to content

Commit

Permalink
Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
doragasu committed Sep 10, 2024
1 parent c414d21 commit f4e539a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/uart_tx_dma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# UART Tx DMA example

This example shows how to use DMA to send data through the UART peripheral. The sample code does the following:

* Send the "Hello World!\r\n" string each second through the UART peripheral, using DMA.
* Toggling a LED each time the DMA transfer is completed, by using the transmission complete interrupt.

The code is extensively commented, so it should be easy to follow and modify.

# Usage

## Wiring

This code can be run as-is in the [nanoch32V003 board](https://github.com/wuxx/nanoCH32V003). The GPIO pin used for the UART Tx funcion is `D5`. It must be connected to a UART receiver (such as a CP2102 board or similar) configured for 115200 bps, no parity and one stop bit.

The example also uses the nanoch32V003 on-board LED connected to `D6`. On any other board either connect a LED to `D6` or edit the code to remap the pin to match your hardware setup.

## Running

Build and flash the project. You should see the LED toggling each second and the UART receiver should get the "Hello World!" message once per second.

0 comments on commit f4e539a

Please sign in to comment.