How to use USART2 and USART1 on NUCLEO-L152RE and Mbed





NUCLEO Page
Home Page

This examples show how to use UASRT1 and USART2 on NUCLEO-L152RE.

Example n.1
USART2 it is used for debug (connected to the PC) using TeraTerm.
USART1 it is used for show the way to use another USART.
Both USART are not used in Interrupt.
The USART parameters are:
Baud Rate: 9600

Data: 8
Parity: NONE
Stop: 1
Flow Control: NONE

The example n.1 code is here.
This example n.1 ready to use for Mbed is here.

Example n.2
USART2 it is used for debug (connected to the PC) using TeraTerm.
USART1 it is used for show the way to use another USART.
Both USART are used in RX Interrupt mode.
The USART parameters are:
Baud Rate: 115200
Data: 8
Parity: NONE
Stop: 1
Flow Control: NONE

The example n.2 code is here.
This example n.2 ready to use for Mbed is here.


How to use this examples
For test this examples connect (with a jumper) D2 to D10 on the NUCLEO-L152RE.
Open Tera Term on your PC and configure it (refering the USART parameters).
 
Press and release the Blue Button and you must see the green LED ON for 1 second.
At the same time some message are displayed via USB Virtual COM on your PC.
 
Similar, if you press E on your Tera Term (PC) you must see the green LED ON for 1 second.


Software
The SW was developed using mbed, in this mode is easy transfer it on another STM32-NUCLEO board.
It is also very easy export this example for use it under KEIL, IAR, CooCox, etc.


Click on the image to enlarge it.





UP





Home Page