The STM32F103C8 performance line microcontroller incorporates the high-performance ARM Cortex™-M3 32-bit RISC core operating at a 72 MHz frequency. This blog will introduce pinout, features, cad models, and other information about STM32F103C8. Hope it can help you.
Catalog
The STM32F103C8 performance line microcontroller incorporates the high-performance ARM Cortex™-M3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories (Flash memory of 64 Kbytes and SRAM up to 20 Kbytes), and an extensive range of enhanced I/Os and peripherals connected to two APB buses. The STM32F103C8 offers two 12-bit ADCs, three general-purpose 16-bit timers plus one PWM timer, as well as standard and advanced communication interfaces: up to two I2Cs and SPIs, three USARTs, a USB, and a CAN.
The STM32F103C8 medium-density performance line microcontroller operates from a 2.0 to 3.6 V power supply. It is available in both the –40 to +85 °C temperature range and the –40 to +105 °C extended temperature range. A comprehensive set of power-saving modes allows the design of low-power applications.
The STM32F103xx medium-density performance line family includes devices in six different package types: from 36 pins to 100 pins. Depending on the device chosen, different sets of peripherals are included, the description below gives an overview of the complete range of peripherals proposed in this family.
These features make the STM32F103xx medium-density performance line microcontroller family suitable for a wide range of applications such as motor drives, application control, medical and handheld equipment, PC and gaming peripherals, GPS platforms, industrial applications, PLCs, inverters, printers, scanners, alarm systems, video intercoms, and HVACs.
Figure1: Stm32f103c8
Figure2: Stm32f103c8 Pinout
Figure3: Stm32f103c8 CAD Model
Product Attribute |
Attribute Value |
Manufacturer: |
STMicroelectronics |
Product Category: |
ARM Microcontrollers - MCU |
Series: |
STM32F103C8 |
Mounting Style: |
SMD/SMT |
Package / Case: |
LQFP-48 |
Core: |
ARM Cortex M3 |
Program Memory Size: |
64 kB |
Data Bus Width: |
32 bit |
ADC Resolution: |
12 bit |
Maximum Clock Frequency: |
72 MHz |
Number of I/Os: |
37 I/O |
Data RAM Size: |
20 kB |
Supply Voltage - Min: |
2 V |
Supply Voltage - Max: |
3.6 V |
Minimum Operating Temperature: |
- 40 C |
Maximum Operating Temperature: |
+ 85 C |
Packaging: |
Tray |
Brand: |
STMicroelectronics |
Data RAM Type: |
SRAM |
Height: |
1.4 mm |
Interface Type: |
CAN, I2C, SPI, USART, USB |
Length: |
7 mm |
Moisture Sensitive: |
Yes |
Number of ADC Channels: |
10 Channel |
Number of Timers/Counters: |
3 Timer |
Processor Series: |
ARM Cortex M |
Product: |
MCU |
Product Type: |
ARM Microcontrollers - MCU |
Program Memory Type: |
Flash |
Factory Pack Quantity: |
1500 |
Subcategory: |
Microcontrollers - MCU |
Tradename: |
STM32 |
Width: |
7 mm |
Unit Weight: |
0.006349 oz |
A common feature used in almost every embedded application is the ADC module (Analog to Digital Converter). These ADCs can read voltages from analog sensors like temperature sensors, tilt sensors, current sensors, bend sensors, etc. Now, we learn how to use the ADC in STM32F103C8 to read the analog voltage. We connect a potentiometer to the STM32 Blue Pill board, change the resistance of the potentiometer to provide different voltages for the ADC and display the read voltage on the 1602 LCD.
There is a 10-channel, 12-bit ADC in the STM32F103C8 with an input range of 0V-3.3V. It maps an input voltage between 0 and 3.3 volts to an integer value between 0 and 4095. The term 10 channels here means that there are 10 ADC pins available for measuring analog voltages. The term 12 bits refers to the resolution of the ADC, meaning 000000000000-111111111111 (212 is 4096). This is the number of sampling steps for our ADC, so our ADC values range from 0 to 4095. The value will increase from 0 to 4095 based on the voltage value per step, which can be calculated in terms of voltage/steps = reference voltage / 4096 = (3.3/4096= 8.056mV) per unit.
Since computers only store and process binary/digital values (1 and 0). Therefore, an analog signal, such as a sensor's volt output, must be converted to a digital value for processing, and the conversion needs to be accurate. When an input analog voltage is provided to the STM32 at an analog input, the analog value is read and stored in an integer variable. The stored analog value (0-3.3V) is converted to an integer value (0-4096) using: Input Voltage = (ADC Value / ADC Resolution) * Reference Voltage Resolution = 4096 Reference Voltage = 3.3VSTM32F103C8T6 ADC Pins There are 10 ADC pins in STM32, from PA0 to PB1.
Figure5: STM32F103C8T6 ADC Pins
Figure6:Circuit Diagram
LCD(number) |
LCD(pin) |
STM32(pin) |
1 |
GND |
GND |
2 |
VCC |
5V |
3 |
VEE |
The pin in the center of the potentiometer |
4 |
RS |
PB11 |
5 |
RW |
GND |
6 |
E |
PB10 |
7 |
D0 |
|
8 |
D1 |
|
9 |
D2 |
|
10 |
D3 |
|
11 |
D4 |
PB0 |
12 |
D5 |
PB1 |
13 |
D6 |
PC13 |
14 |
D7 |
PC14 |
15 |
A(LCD Backlight cathode) |
5V |
16 |
K(LCD Backlight Negative) |
GND |
The 1602 LCD is connected according to the table above. There are two potentiometers in the circuit, the first one is used as a voltage divider to change the voltage and provide an analog input to the STM32. The left pin of this potentiometer gets input positive voltage from STM32 (3.3V), the right pin is grounded, and the center pin of the potentiometer is connected to the analog input pin (PA7) of STM32. Another potentiometer is used to change the contrast of the LCD. The STM32 is powered by the PC's USB power supply.
Figure7: LCD and STM32 connection
Connect the STM32 to a PC via its USB port and start programming with the ARDUINO IDE. In the program, read the analog value and use that to calculate the voltage, then display the analog and digital values on the LCD screen.
#include <LiquidCrystal.h> // LCD library
//First define the LCD pins. These define to which pin of the STM32 the LCD pin is connected.
// You can modify it according to your requirements.
const int rs = PB11, en = PB10, d4 = PB0, d5 = PB1, d6 = PC13, d7 = PC14;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7); //Initialize LCD
const int analogip = PA7;//analog input pin
void setup()
{
lcd.begin(16, 2); //We are using 16*2 LCD
lcd.clear(); // clear screen
lcd.setCursor(0, 0); //Set the cursor on the first row and first column
lcd.print("Hello World!"); //LCD displays this
lcd.print("STM32F103C8"); //LCD displays this column
lcd.print("STM32F103C8"); //LCD displays this
delay(2000);//wait for two seconds
lcd.clear(); // clear screen
lcd.setCursor(0, 0); //Set the cursor on the first row and first column
lcd.print("USING ADC IN");//print this
lcd.setCursor(0,1); //Set the cursor in the second row and first column
lcd.print("STM32F103C8");//print this
delay(2000); //wait for two seconds
lcd.clear(); // clear screen
}
void loop()
{
int val = analogRead(PA7); // read ADC value from pin A7
float voltage = (float(val)/4096) * 3.3; // convert ADC value to voltage value
lcd.setCursor(0, 0); // set the cursor to column 0, row 0
lcd.print(val); //Display ADC value
lcd.setCursor(0, 1); // set the cursor to column 0, row 1
lcd.print(voltage);//display voltage
}
ESP32-CAM can be used in various Internet of Things situations and is suitable for home smart devices, industrial wireless control, wireless Monitoring, QR wireless identification, wireless positioning system signals, and other IoT applications are ideal solutions for IoT applications.
Read More >ESP32-CAM is a development board with an ESP32-S chip, an OV2640 camera, a microSD card slot, and several GPIOs for connecting peripherals. ESP32-CAM is a small-sized camera module. The module can work independently as the smallest system, with a size of only 27*40.5*4.5mm.
Read More >The MCP73833/4 is a highly advanced linear charge management controller for use in space-limited, cost sensitive applications. Both a 10-lead, MSOP and a 10-lead, DFN packaging measuring 3 mm by 3 mm are offered for the MCP73833/4. In addition to its tiny size, the MCP73833/4 is perfect for portable applications because it requires a few additional components.
Read More >In the realm of electronics, where connectivity and isolation are paramount, the 4N35 optocoupler IC stands as a beacon of reliability and versatility. This small yet mighty device plays a crucial role in ensuring signal integrity and safety across a wide range of applications. In this article, we delve into the intricacies of the 4N35 optocoupler IC, exploring its datasheet, pinout, circuit diagram, and diverse uses.
Read More >The UA741CP is a general-purpose operational amplifier in an 8-pin DIP package. The high common-mode input voltage range and lack of latch-up make the amplifier ideal for voltage follower applications.
Read More >