:::: MENU ::::

STM32F0 Discovery USART example

STM32F0 Discovery USART example

After a  long trail & error finally all the settings for the USART peripheral set correctly and here is a quick tutorial how to do it. Complete Atollic project will be uploaded on my github repository in a days, anyway following this tutorial you should be able to do it. Firstely open Atollic IDE and crate new blank project for your STM32F0 Discovery boar.

Step 1

Step 1

step 2

step 2

STEP 3

STEP 3

STEP 4

STEP 4

STEP 5

STEP 5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 

 

 
At this point the wizard did the magic and it is time to tweak the main.c the source bellow is the original main.c
 

Add this part to main.c first you need to add usart.h library and add message you will send and add the Send_Byte() function

Add USART initialization in the GPIO initialization part (USART2 pins: Rx (PA2) and Tx (PA3))

Modify the while(1) routine so when you press the User button on the STM32F0 Discovery board you will see text transmitted from the board.

 

32