The STM32F103C8T6 is a 32-bit microcontroller manufactured by STMicroelectronics. It is based on the ARM Cortex-M3 core and is designed for high-performance, low-power embedded applications. With 64KB of flash memory, 20KB of SRAM, and a wide range of peripherals, this microcontroller is a versatile choice for a variety of projects.
Explore Projects Built with STM32F103C8T6
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit features an STM32F103C8T6 microcontroller interfaced with a membrane matrix keypad for input, an RTC DS3231 for real-time clock functionality, and a 16x2 I2C LCD for display. It controls four 12V geared motors through two MD20 CYTRON motor drivers, with the motor power supplied by a 12V battery regulated by a buck converter. The battery is charged via a solar panel connected through a solar charge controller, ensuring a renewable energy source for the system.
This circuit features an STM32F103C8T6 microcontroller powered by a 3.3V battery, which controls a red LED. The LED is connected to pin A1 of the microcontroller through a 10-ohm resistor to limit the current.
This circuit features an STM32F103C8T6 microcontroller interfaced with a China ST7735S 160x128 display and two spectral sensors (Adafruit AS7262 and AS7261). It also includes two pushbuttons for user input, with the microcontroller managing the display and sensor data processing.
This circuit is designed to control LEDs, a DC motor, and a servo motor using an STM32F103C8T6 microcontroller. It includes a motor driver for the DC motor, a voltage regulator for stable power supply, and an RS485 to USB converter for communication. User inputs can be provided through pushbuttons, and a potentiometer allows for variable analog input.
Low-power modes available (down to 2 µA in standby mode)
Package
LQFP-48
Pin Configuration and Descriptions
The STM32F103C8T6 comes in a 48-pin LQFP package. Below is a table summarizing the key pins and their functions:
Pin Number
Pin Name
Function
Description
1
VDD
Power Supply
Positive power supply (2.0V to 3.6V)
2
VSS
Ground
Ground connection
4
PA0
GPIO/ADC_IN0
General-purpose I/O or ADC input channel
14
PB6
GPIO/I2C1_SCL
I2C1 clock line or GPIO
15
PB7
GPIO/I2C1_SDA
I2C1 data line or GPIO
22
PA9
GPIO/USART1_TX
USART1 transmit or GPIO
23
PA10
GPIO/USART1_RX
USART1 receive or GPIO
37
PC13
GPIO
General-purpose I/O
48
NRST
Reset
Active-low reset pin
For a complete pinout, refer to the STM32F103C8T6 datasheet.
Usage Instructions
How to Use the STM32F103C8T6 in a Circuit
Power Supply: Connect the VDD pin to a 3.3V power source and the VSS pin to ground. Ensure proper decoupling capacitors (e.g., 0.1 µF) are placed close to the power pins.
Clock Configuration: Use an external 8 MHz crystal oscillator connected to the OSC_IN and OSC_OUT pins for accurate timing. Alternatively, the internal RC oscillator can be used.
Programming: The STM32F103C8T6 can be programmed using the SWD (Serial Wire Debug) interface or USART1. Tools like ST-Link or USB-to-serial adapters are commonly used.
GPIO Configuration: Configure GPIO pins as input, output, or alternate function using the STM32 HAL (Hardware Abstraction Layer) or direct register manipulation.
Peripherals: Enable and configure peripherals (e.g., UART, SPI, I2C) using the STM32CubeMX tool or STM32 HAL libraries.
Important Considerations and Best Practices
Voltage Levels: Ensure all input signals are within the 3.3V logic level range to avoid damage.
Decoupling: Place decoupling capacitors near the power pins to reduce noise and improve stability.
Boot Modes: Use the BOOT0 and BOOT1 pins to select the boot mode (e.g., boot from flash, system memory, or SRAM).
Debugging: Use the SWD interface for debugging and firmware uploading. Ensure the SWDIO and SWCLK pins are accessible.
Example: Using STM32F103C8T6 with Arduino IDE
The STM32F103C8T6 can be programmed using the Arduino IDE with the STM32duino core. Below is an example of blinking an LED connected to pin PC13:
// Include the Arduino core for STM32
#include <Arduino.h>
// Define the LED pin
#define LED_PIN PC13
void setup() {
// Set the LED pin as output
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(LED_PIN, HIGH);
delay(500); // Wait for 500 ms
// Turn the LED off
digitalWrite(LED_PIN, LOW);
delay(500); // Wait for 500 ms
}
To upload the code:
Install the STM32duino core in the Arduino IDE.
Select "Generic STM32F103C8T6" as the board.
Use an ST-Link or USB-to-serial adapter for programming.
Troubleshooting and FAQs
Common Issues
Microcontroller Not Responding:
Cause: Incorrect power supply or missing decoupling capacitors.
Solution: Verify the power supply voltage and ensure proper decoupling.
Cannot Upload Code:
Cause: Incorrect boot mode or programming interface not connected.
Solution: Set BOOT0 to 1 (system memory boot) for USART programming or ensure SWD pins are connected for ST-Link.
Peripherals Not Working:
Cause: Incorrect clock configuration or peripheral initialization.
Solution: Use STM32CubeMX to generate proper initialization code.
FAQs
Can I use the STM32F103C8T6 with 5V logic?
No, the STM32F103C8T6 operates at 3.3V logic levels. Use level shifters if interfacing with 5V devices.
What is the maximum clock speed?
The maximum clock speed is 72 MHz.
How do I reset the microcontroller?
Use the NRST pin or software reset commands.
Can I use the internal oscillator?
Yes, the internal RC oscillator can be used, but an external crystal is recommended for better accuracy.
By following this documentation, users can effectively integrate the STM32F103C8T6 into their projects and troubleshoot common issues. For more details, refer to the official datasheet and reference manual from STMicroelectronics.