Introduction: How to Receive Data From STM32 Based Microcontroller to PC

About: Hi all, I'm Pawan Joshi who works on embedded system and IoT. I'm really passionate about embedded system and IoT. Here through this page you will come to know about embedded system from scratch to the latest …

Here in this tutorial we have transmitted data from microcontroller to PC using one of the UART of STM32l100 mcu.

Step 1: Software Used:

These are the software we have used for this project:

1. Atollic TrueSTUDIO: Atollic® TrueSTUDIO® for STM32 is a flexible and extensible development and debugging IDE for STM32 MCU developers who want extremely powerful tools to aid in development of high-quality embedded software. TrueSTUDIO® is based on open standards (ECLIPSE and GNU) and extended with professional features for code management and advanced system analysis. This gives a unique insight into the structure and the dynamic behavior of the system.

You can download this software from this link

2. STM32CubeMX: STM32CubeMX is a graphical tool that allows a very easy configuration of STM32 microcontrollers and microprocessors, as well as the generation of the corresponding initialization C code for the Arm® Cortex®-M core or a partial Linux® Device Tree for Arm® Cortex®-A core), through a step-by-step process.

You can download this software from this link

Step 2: Components Used:

There are mainly two hardwares we have used in this tutorial:

1.32L100CDISCOVERY: The 32L100CDISCOVERY helps you to discover the features of the STM32L100 Value Line 32-bit Cortex®-M3 microcontrollers and to develop your applications easily. It includes everything required for beginners and experienced users to get started quickly. Based on the STM32L100RCT6 , it includes an ST-LINK/V2 embedded debug tool, LEDs, pushbuttons for easy connection of additional components and modules.

2. USB to TTL converter. As in this discovery board we can not get serial data directly from st-link debugger cable so we have to buy one usb to TTL converter. The working principle of USB to TTL converter is very simple.This is an USB to TTL UART Converter module which is based on CP2102 Bridge by SiLabs. This module can be used with Laptop's which don't have standard serial port. This module creates a virtual COM port using USB on your computer which can support various standard Baud Rates for serial communication.

Step 3: Circuit Diagram

Connections are as below:

32L100discovery boardUSB to TTL converte

Txd of discovery board(PA9) Rxd

GND GND

3V3 3V3

Step 4: Code:

As we have created the code with the help of STM32CubeMX, so here I'm sharing you the main.c file.

you can get the main.c file from below link

Attachments

Step 5: Working Principle and Video:

Here first you need to open up the STM32CubeMX then you need to chose the right board or mcu if you are using a customized board.

For whole process please watch our embed video.

The whole Project Description is given in above video

If you have any doubt regarding this project feel free to comment us below. And if you want to learn more about embedded system you can visit our youtube channel

Please visit and like our Facebook Page for frequent updates.

Thanks & Regards,

Embedotronics Technologies