Introduction: Alternative to STM32F103C8T6 by GigaDevice
Introducing GD32F103C8T6 by GigaDevice as a cheap and faster alternative to STM32F103C8T6
Step 1: What Is STM32F103C8T6?
STM32F103C8T6 is a microcontroller which can be used as an alternative to the Arduino boards. Arduino would have been the first board for many hobbyists (including me) and engineers out there when they started with electronics.
However, as we start building more and dig deep we would soon realize that Arduino is not industry ready and its 8-bit CPU with a ridiculously slow clock, it does not give you enough juice for your projects. Hopefully, though, we have the new STM32F103C8T6 STM32 Development Boards (Blue Pill) in the market now which can easily outperform Arduino with its 32-bit CPU and ARM Cortex M3 architecture. Another honey pot here is that we can use the same old Arduino IDE to program our STM32 Boards. So in this tutorial, let us get started with the STM32 to know a bit of basic about this board and blink the onboard LED using the Arduino IDE.
This project is sponsored by LCSC. I have been using electronic components from LCSC.com. LCSC has a strong commitment to offering a wide selection of genuine, high-quality electronic components at the best price with a global shipping network to over 200 countries. Sign up today and get $8 off on your first order.
These microcontrollers are made by STMicroelectronics, which is a global independent semiconductor company. Board with STM32F103C8T6 as it's brain are also nicknamed as Blue Pill.
Step 2: Specifications of STM32F103C8T6 Blue Pill Board
- Core: Cortex-M3 32-bit
- Operating frequency: 72MHz
- Storage resources: 64K Byte Flash, 20KByte SRAM
- Interface Resources: 2x SPI, 3x USART, 2x I2C, 1x CAN, 37x I / O ports
- Analog-to-digital conversion: ADC (12-bit / 16-channel)PWM: 16-bit/15 channel
- USB Device: 1Timers: 3 general timers and 1 advanced timer
- Debug Download: Support JTAG / SWD debug interface to download, support for IAP
Step 3: Now, GigaDevice's GD32F103C8T6?
GigaDevice, the leading provider of Non-Volatile Memory (NVM) devices, is the company engaged in advanced memory and related chip design in Mainland China established in 2005.
GigaDevice made STM's twin which has faster speed due to the faster clock of 108 MHz as compared to 72 MHz of STM.
Like STM, these are also based on the ARM CortexTM-M3 RISC core with the best ratio in terms of processing power, reduced power consumption and peripheral set. The CortexTM-M3 is a next-generation processor core which is tightly coupled with a Nested Vectored Interrupt Controller (NVIC), SysTick timer and advanced debug support.
Step 4: Specifications of GD32F103C8T6
- Package: TQFP-48_7x7x05P
- Core Size: 32-Bit
- Program Memory Type: FLASH
- Core Processor: ARM® Cortex®-M3
- Operating Frequency: 108MHz
- Voltage - Supply (Vcc/Vdd): 2.6V ~ 3.6V
- Program Memory Size: 64KB
- RAM Size: 20KB
- Number of I/O: 37
- A/D: 10x12bit
- D/A: 0
- PWM: 2
- UART/USART: 3
- SPI: 2
- I2C/SMBUS: 2
- USB Device: 1
- USB Host/OTG: 1
- CAN: 1
Step 5: Comparison Between the Two Devices
Almost all the specifications and details of both the microcontrollers are the same with same flash size, RAM, processor core, and pinouts.
The most significant difference is that the GD32F103C8T6 has more operating frequency with 108 MHz as compared to the 72 MHz of STM32F103C8T6. So, If you are looking for a faster speed for processing the long codes and commands with bit big calculation, GigaDevice has a proper alternative. Although you may need to make some changes when you start programming GigaDevice board so as to make delay() function and other timer related functions. The delay() functions are hard-coded loops of nops which assume 72Mhz, so that would need to be changed as well.
You can go through these changes in stm32.h:
File Path: \IDE\hardware\Arduino_STM32\STM32F1\system\libmaple\stm32f1\include\series
# if STM32_F1_LINE == STM32_F1_LINE_PERFORMANCE # ifndef STM32_PCLK1 # define STM32_PCLK1 54000000U // << from 36000000 # endif # ifndef STM32_PCLK2 # define STM32_PCLK2 108000000U // << from 72000000
1 year ago
Thanks for this great article.
Can you suggest me a alternative of STM32F030CCT6 in GigaDevices please?
2 years ago
My company is currently checking if the Gigadevice GD32F103xxx chip can be used instead of STM32F103RCTX processor (we are forced to check for alternatives because of the extremely long lead times (~1year) and also high pricing for ST right now).
First trials seemed succesfull (small adjustments regarding timing, different behaviour for I2C communication for certain telegram lengths), however we are struggling right now with the ADC accuracy (when ramping up input voltage from 0 to VDDA, ADC value is only partly following, being stuck to 0x40 steps in between, e.g. values changing like
0, 0, 0, 3, 7, 11, 15, 20, 26, 31, 38, 64, 64,64,64,64,69,71,.....,128,128,128,128,128,...)
Already tried several configurations (only 1 channel, sampling time min/max, ADC clock timing different values, DMA mode or polling,..), always getting same result.
Would be nice to know if someone has faced similar problems or is able to reproduce the issue. (Executing the ramp function with identical board and ST-processor gives the expected smooth result)
Question 2 years ago on Step 5
Really interesting article!
Is this the only difference between STM and Gigadvice?
Do all the Arduino IDE code developed and compiled for Bluepill work on Gigadevice just adjusting the PCLK settings?
Currently, STM32 extremely long leadtimes makes Gigadevice a promising alternative in JLCPCB/LCSC.