Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Getting Started with STM32 Microcontroller : Blinking of LED
STM32 Projects

Getting Started with STM32 Microcontroller : Blinking of LED

Mamtaz AlamBy Mamtaz AlamUpdated:August 22, 20224 Comments5 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
STM32 Arm Microcontroller Tutorial Getting Started with STM32F103C8T6 Bluepill & Arduino IDE
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Getting Started with STM32F103C8T6 STM32 Development Board

Arduino is the first board for many when they started with electronics. But when we go deeper we understand that Arduino is not industry ready development board and its 8-bit CPU with a ridiculously slow clock and maybe not suitable for higher-level projects. So we need to move to an advance level and we have the new STM32F103C8T6 STM32 Development Boards also known as Blue Pill. It has a 32-bit CPU and based on ARM Cortex M3 architecture.

So in this post we will be covering all these areas:

  1. Getting Started with STM32F103C8T6 STM32 Microcontroller
  2. Installing STM32 Board to Arduino IDE via Board Manager
  3. Learn about Input/Output pins of STM32
  4. Setting STM32 with USB to TTL Converter and connection diagram
  5. Method for uploading Code to STM32 Microcontroller
  6. Blink of LED using STM32 as beginners Guide




Components Required:

1. STM32F103C8T6 STM32 Microcontroller Board
2. USB-TTL Converter/FTDI
3. Breadboard
4. Connecting Wires


STM32F103C8T6 STM32 (Blue Pill) Board:

Before Getting Started with STM32 Microcontroller, we need to know about STM32. The datasheets of STM32 contain all the information. Some of the information is explained below:

Introduction:

The STM32 family of microcontrollers from STMicroelectronics is based on the ARM Cortex-M 32-bit processor core. The STM32 series are some of the most popular microcontrollers used in a wide variety of products. They also have an excellent support base from multiple microcontroller development forums.

STM32

STM32 microcontrollers offer a large number of serial and parallel communication peripherals which can be interfaced with all kinds of electronic components including sensors, displays, cameras, motors, etc. All STM32 variants come with internal Flash memory and RAM.


The range of performance available with the STM32 is quite expansive. The board also holds two crystal oscillators, one is an 8MHz crystal, and the other is a 32 kHz crystal, which can be used to drive the internal RTC (Real Time Clock). This enables the MCU to operate in deep sleep modes making it ideal for battery-operated applications. There are also two on-board LEDs, one (red color) is used for power indication, and the other (green color) is connected to the GPIO pin PC13.

STM32F103C8T6 Full Form & Meaning:

“Blue Pill” or STM32F103C8T6 name has a meaning behind it.

STM – stands for the manufacturer’s name STMicroelectronics
32 – stands for 32-bit ARM architecture
F103 – stands to indicate that the architecture ARM Cortex M3
C – 48-pin
8 – 64KB Flash memory
T – package type is LQFP
6 – operating temperature -40°C to +85°C

Specifications:

Manufacturer: STMicroelectronics
Product Category: ARM Microcontrollers MCU
Mounting Style: SMD/SMT
Core: ARM Cortex M3
Data Bus Width: 32 bit
Maximum Clock Frequency: 72 MHz
Program Memory Size: 64 kB
Data RAM Size: 20 kB
ADC Resolution: 12 bit
Number of I/Os: 37 I/O
Operating Supply Voltage: 2 V to 3.6 V
Operating Temperature: – 40 C to + 85 C
Interface Type: CAN, I2C, SPI, USART, USB
Program Memory Type: Flash
Number of ADC Channels: 10
Number of Timers/Counters: 3 Timer

Pin Details:

STM32 Pin Details




Method to Program STM32 Microcontroller:

There are 6 methods by which you can program STM32 Microcontroller. The methods are:
1. STM32duino Bootloader Method
2. Serial Method
3. By using ST-Link Debugger
4. By BMP (Black Magic Pro)
5. Jlink Method
6. By HID bootloader 2.0

But here we will be using the most popular method, i.e Serial Method to program STM32 Microcontroller. For this, you need USB to TTL Converter. And we are using FTDI Module to program STM32. The connection diagram between STM32 and USB to TTL is given below.

STM32 USB TTL Connection

Connect GND of FTDI to GND of STM32
Connect 5V/3.3V of FTDI to 5V/3.3V of STM32
Connect Rx of FTDI to A9 (Tx) of STM32
Connect Tx of FTDI to A10 (Rx) of STM32


Setting up STM32 with Arduino IDE:

Before getting started with STM32 we need to add STM32 board library to Arduino IDE so that we can program STM32 using Arduino IDE.

So for this follow the following steps:

Step 1:
Click on file then click on Preference and then add the following link below:

C++
1
http://dan.drown.org/stm32duino/package_STM32duino_index.json

Step 2:
Click on Tools >>>>>> Boards >>>>>> Board Manager
Then Type STM32F1 and then install the board that you get on board manager

Step 3:
After installation is completed, make the following changes by selecting these options



Blinking of LED using STM32 as a Test Program:

Now you can connect USB to TTL converter to your PC. To connect FTDI with STM32 follow the above circuit Make sure that the FTDI driver is installed on your PC else, Arduino IDE won’t show port.

Now you can copy the blink sketch form below and upload it to STM32 Board. This can be done by simply compiling and then uploading the same as what you do with Arduino Board.

During the uploading process, you will see the following written on IDE Console.


Source Code/Program for Blinking of LED:

1
2
3
4
5
6
7
8
9
10
11
12
13
#define LED_BUILTIN PC13
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}


Video Tutorial & Full Explanation:

If you still face the problem of getting

started with STM32, you can watch the full detailed tutorial video and guide below.

STM32 Tutorial | Getting Started with STM32F103C & Arduino IDE
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleArduino DS3231 Real Time Clock (RTC) with Temperature Monitor
Next Article Automatic LED Blinking Circuit using 555 Timer IC – LED Flasher

Related Posts

PIR Motion Detection using Bluetooth & STM32 Board

PIR Motion Detection using Bluetooth & STM32 Board

Updated:December 23, 20234K
STM32 SHT85 Humidity Temperature Sensor

Collecting SHT85 Sensor Data using STM32 & Bluetooth Low Energy

Updated:August 20, 20222K
SX1276 STM32

Interfacing LoRa SX1276 with STM32 Microcontroller | LR1276-915MHz

Updated:May 29, 2023112K
BLE enabled Smart Bulb with STM32 & Javascript

BLE enabled Smart Bulb with STM32 & Javascript

Updated:August 20, 20222K
Create BLE Project using STM32 Microcontroller & BlueIO

Create BLE Project using STM32 Microcontroller & BlueIO

Updated:August 20, 202212K
DS18B20 STM32

Interfacing DS18B20 Temperature Sensor with STM32

Updated:August 21, 2022110K
View 4 Comments

4 Comments

  1. Mashal on October 19, 2021 12:33 PM

    Greetings. I super new to STM boards, so I apologize for saying anything dumb. I have a CP2102 USB to TTL module. Can I use that to program my blue pill? Also, can I use the same procedure in STM32CUBE IDE? Most of the tutorials say I need a ST-Link V2(SWD instead of the regular serial TX/RX).

    Reply
    • Admin on October 19, 2021 12:37 PM

      You can program with multiple method euther with FTDI or stlink.

      Reply
  2. Erik Bongers on December 31, 2021 5:13 AM

    Note that with the Blue Pill, the LED will go OFF when PC13 is set HIGH.
    This is due to the fact that pin PC13 is current sinking (it ‘draws’ current but it does not ‘provide’ current).

    Reply
  3. Muhammad Al Mahdi‬‏ on July 11, 2023 2:25 PM

    Hello , Sir .I strongly need your help. I’m simulating STM32F103C6 on Proteus , and the code is written on Arduino IDE, I’m testing a simple LED blink project and the simulation is not working!
    I tried the code by STM32CUBE IDE and the simulation worked properly, can you help me to make it work with Arduino IDE ?
    I have tried all compiler optimization levels in Arduino IDE but none of them worked for me !

    Reply

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • How to use INA219 DC Current Sensor Module with Arduino
    How to use INA219 DC Current Sensor Module with Arduino
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
  • IoT Based Drinking Water Quality Monitoring with ESP32
    IoT Based Drinking Water Quality Monitoring with ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.