DIY Core Board for STM32 – A Cost-Effective Solution

Introduction

Spent over 30 yuan to make a core board, which is a domestic chip replacement solution for the STM32 blue board.

DIY Core Board for STM32 - A Cost-Effective Solution

Full Text Navigation (7 Parts)

Chip description, hardware description,circuit principle, material inventory, design + welding + debugging precautions, advantages and characteristics, circuit source code download

Chip Description

First, the domestic chip that replaces STM32 is called – HK32F103C8T6.

The reason for using it is that it has a high-performance ARM Cortex-M3 core, rich peripheral configuration, low price, and low power consumption.

Hardware Description

The core board consists of 6 parts as described below, and the disassembly diagram will be more intuitive.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 2-1 HK32F103C8T6 Core Board Resource Diagram
Main Control Chip: HK32F103C8T6, LQFP-48;
② Power Interface: TYPE C, plug-in 2Pin;
③ LED Display: 1 power indicator, 1 status display light;
④ Boot Mode: BOOT mode configuration, 2x3Pin straight plug header;
⑤ Debug Interface: SWD programming method, 4Pin bent plug header;
⑥ External Pins: Programmable I/O ports, 2 1x20Pin straight plug headers.
Circuit Analysis

The circuit design of the core board is relatively simple. In this chapter, I will break the circuit into 5 parts and explain the principles respectively.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-1 SCH_HK32F103C8T6 Minimum System
01
Power Circuit

The power circuit mainly consists of TYPE-C power supply circuit and LDO-5V to 3.3V circuit, using a 2Pin TYPE-C interface, simple and convenient, easy to solder.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-2 TYPE-C Power Supply Circuit

Among them, the LDO-5V to 3.3V step-down circuit outputs 3.3V from the 5V input of the TYPE-C power supply circuit to power the main control chip.

The capacitor is for filtering to make the output voltage signal more stable.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-3 LDO-5V to 3.3V Circuit
02
Main Control Circuit

The pins of HK32F103C8T6 can be roughly divided into 4 categories: power, clock, control and I/O pins;

Figure 4-4 shows the pin definition diagram of HK32F103C8T6, and the following text explains the definition reuse of each pin.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-4 HK32F103C8T6 (LQFP48) Pin Definition Diagram
①VBAT(1.8-5.5V): Connect to external battery, providing power for RTC, external oscillator and backup register; if not needed, connect to power;
②VDD(2.0-5.5V): Power supply voltage for the microcontroller, for I/O pins and internal LDO;
③VDDA(2.0-5.5V): Power supply for the internal ADC, temperature sensor and other analog devices;
④VSS: Ground terminal of the microcontroller;
⑤VSSA: Common ground for analog devices;
⑥OSC32_IN: Inverting input of the oscillator circuit;
⑦OSC32_OUT: Inverting output of the oscillator circuit;
⑧PC13-TAMPER-RTC: IO port/RTC external interface, has intrusion detection function, when the pin level state changes, it will generate an intrusion detection event, which will clear all data backup register contents.
⑨PC14-OSC32_IN/PC15-OSC32_OUT: External low-speed crystal oscillator (RTC crystal oscillator IO);
⑩PD0-OSC32_IN/PD1-OSC_OUT: External high-speed crystal oscillator (main crystal oscillator IO);
NRST: Reset pin, for external manual reset;
⑪BOOT0/BOOT1: Boot setting pins, during startup, the system boot mode is determined by reading the interface status;

As shown in Figure 4-5, connecting all the pins of HK32F103C8T6 will facilitate project development.

Here, the capacitor is for filtering, and should be placed as close to the chip pins as possible, the connection method of the main control circuit pins is shown in the figure below.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-5 HK32F103C8T6 Main Control Circuit
03
Crystal Oscillator Circuit

The role of the crystal oscillator is to provide clock signals for the minimum system, and the capacitors next to the crystal oscillator ensure that the output oscillation frequency is more stable.

The 32.768kHz crystal oscillator provides clock signals for the RTC, while the 8MHz crystal oscillator circuit provides clock signals for the microcontroller; if the RTC function is not needed, then the RTC crystal oscillator can be left unconnected.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-6 RTC Crystal Oscillator Circuit
DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-7 Main Crystal Oscillator Circuit
04
Reset Circuit

Resetting is also called rebooting, pressing the SW1 button pulls down the main control NRST pin, generating an external reset pulse to reset the system; releasing the SW1 button restores normal working status, and the reset pin is at a high level.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-8 Reset Circuit
05
Peripheral Circuit

① When powered on, the power indicator (red) lights up, indicating that the minimum system power supply part is working normally.

The status display light (blue) is used for testing the microcontroller PC13 pin, achieving the on/off of the test light through programming.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-9 LED Indicator Circuit

② SWD download interface, using the SWD programming method, reserving a 1x4Pin bent plug header interface for downloading debugging simulation programs.

The capacitor is for filtering, making the downloading performance more stable.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-10 Download Circuit

③ Boot selection mode, before downloading the program, the boot mode of the microcontroller must be controlled by the high and low levels of the BOOT0 and BOOT1 pins to successfully download the program, detailed configuration is shown in Table 1-1.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-11 BOOT Mode Selection
DIY Core Board for STM32 - A Cost-Effective Solution
Table 1-1 BOOT Pin Configuration Boot Mode
  • When using SWD programming, BOOT0 and BOOT1 need to be grounded.

  • When using serial ISP programming, BOOT0 needs to be connected to power, BOOT1 grounded.

④ The function of the external I/O port is to facilitate project expansion and various function verification.

It requires 2 1x20Pin 2.54mm headers to connect the microcontroller’s I/O pins, compatible with other mainstream microcontroller core board pin arrangements.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 4-12 External I/O Port
Material Inventory

DIY Core Board for STM32 - A Cost-Effective Solution

Precautions

Finally, let me explain the precautions for schematic design, PCB routing, soldering, and debugging, a total of 4 parts.

01
Drawing Schematic

① Draw according to module circuit division, indicating the circuit function;

② Unused pins should have non-connection symbols, for professional standards;

③ Fill in project name and other information on the drawing properties;

02
PCB Layout

① The main control chip should be placed at 45 degrees, facilitating the routing of external header pins;

② Pay attention to the current direction of the filtering capacitor, try to keep it close to the filtering components;

③ The crystal oscillator should be as close to the chip as possible, and avoid routing underneath to prevent signal crosstalk;

④ Routing should prioritize straight lines, and for turns, use obtuse angles or arcs;

⑤ After adjusting the PCB layout, add teardrops to make the board more aesthetically pleasing and stable;

⑥ Add silkscreen markings to annotate the function of interfaces;

⑦ JLCJLCJLCJLC designated silkscreen can be hidden under components for a more attractive board;

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-1-1 PCB Routing Reference Diagram – Top Layer
DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-1-2 PCB Routing Reference Diagram – Bottom Layer
03
Soldering

① When soldering, you can click on the soldering helper tool in JLC’s EDA toolbar for real-time interaction to facilitate soldering;

② When soldering the top layer, it is recommended to solder the main control chip first to avoid interference from other components;

③ When soldering the header pins, use a spare board or perforated board to hold them in place to prevent slanting during soldering;

④ The soldering sequence should follow the principle of low to high to avoid affecting the soldering of small components;

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-2-1 PCB Empty Board – Top Layer
DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-2-2 PCB Empty Board – Bottom Layer
DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-4 3D Rendering
04
Debugging

① Before powering on for debugging, check if there are any cold soldering or short circuit issues; only power on for testing after confirming there are no issues;

② When using SWD programming, the BOOT0 and BOOT1 pins need to be grounded with a shorting cap;

③ Download and install the HK32F103 support package in advance.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 6-5 HK32F103C8T6 Minimum System Working Diagram
Advantages and Characteristics

Finally, let me briefly explain the advantages and characteristics of the core board.

DIY Core Board for STM32 - A Cost-Effective Solution
Figure 3-1 HK32F103C8T6 Core Board Size Diagram

① The board is compact, measuring only (53.3mm*22.9mm(2100mil*900mil));

② Compatible with STM32F103C8T6 and other mainstream F103 core board pin arrangements.

③ Low price, ultra-low power consumption, rich functional pins, high cost performance;

④ Uses high-quality PCB and genuine components from JLC to ensure product quality;

Attachment Download

If you also want to DIY a core board for making a small car or robot… you can click “Read Original” > “Open in Editor” … to view the circuit source file.

DIY Core Board for STM32 - A Cost-Effective Solution

DIY Core Board for STM32 - A Cost-Effective Solution

DIY Core Board for STM32 - A Cost-Effective Solution

Open Source Code: “Read Original” > “Click Attachment Download Option” > “Click Download” > “After downloading, unzip and open with Keil”

DIY Core Board for STM32 - A Cost-Effective Solution
Step 1: Click the text to download the attachment
DIY Core Board for STM32 - A Cost-Effective Solution
Step 2: After downloading, unzip and open with Keil
Like if you enjoy reading!
DIY Core Board for STM32 - A Cost-Effective Solution
Click here to view the original project

Leave a Comment

×