Tutorial: USART with TeraTerm
Last updated
Last updated
We are going to create a simple program that links MCU-PC via UART communication. MCU can receive and transmit 8-bit character data through UART communication.
NUCLEO-F401RE board offers UART2 channel with USB connector.
Select the lastest version (5.x ) . Download the release version (*.exe) file and install
After installation, open ‘Tera Term’ and make New Connection.
Choose ‘Serial’ tab -> Select ‘COMx: STMicroelectronics STLink’ port
COMx, x is the port number and it can be different for each connection.
Setup(ì„¤ì •) > SerialPort
check the baud rate is set as 9600 [bps] and data is 8-bit
use the default configuration for the other options.
First, download the provided USART libray header files
A simple code that prints a message from MCU to PC.
After you flash the code, press the MCU RESET button(black button).
The following test code echos the pressed input key (from PC) back to the PC (TeraTerm display).
If you press any key on the Tera Term window, the MCU will receive it and then transmit the key back to the PC immediately. Thus, you can see what key you are pressing on the Tera Term window display.
Here, it uses USART Receive Interrupt handler.
The following test code echos the pressed input key (from PC) back to the PC (TeraTerm display).
If you press any key on the Tera Term window, the MCU will receive it and then transmit the key back to the PC immediately. Thus, you can see what key you are pressing on the Tera Term window display.