Skip to main content

Chapter 3 Serial Communication: UART

The goal of this chapter is to send text from our microcontroller to a terminal window on a laptop, and to read characters typed in that window back into our program. We’ll do this with the Universal Asynchronous Receiver-Transmitter (UART), one of the serial interfaces built into the STM32C031C6. So far our programs could only communicate with the outside world by blinking an LED. Once printf() reaches your laptop we have a debugging tool we’ll use for the rest of the term, and a way to build an interface a person can read. UART is also the simplest and most ubiquitous serial protocol in embedded systems, and the same frame format turns up again on the Bluetooth module later in the course.