U(S)ART (Universal Asynchronous/synchronous Receiver and Transmitter)
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.
A simple code that prints a message from MCU to PC.
After you flash the code, press the MCU RESET button(black button).
Code 2
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.
Arduino
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.