Using STM32F103C8 (Blue Pill) Controllers with Arduino IDE

Basic tech. specifications:

ARM Cortex M3
Bit depth – 32-bit
Frequency – 72MHz
Flash memory – 64KB / 128KB
RAM – 20KB
SPI – two pieces
I2C – two pieces
UART – three hardware UARTs + USB (that is, four interfaces are obtained)
CAN bus
ADC – 12-bit
PWM – 16 bit
Supply voltage – from 2 to 3.6V (that is, it can be powered by two “finger” batteries)
Internal real-time clock (there is a special pin on the board – Vbat, for connecting the battery)

Basic information on using STM32 controllers with the Arduino IDE can be found here: https://github.com/stm32duino/wiki/wiki/Getting-Started.

 


Some information from personal experience.

I am programming using STM32CubeProgrammer(Serial) mode.

 

To use this mode, you must install the STM32CubeProgrammer program on your computer. As I wrote earlier, there is a crazy person in the world, and therefore you can download this program from Russia only through VPN, and then deceiving the system with your place of residence. I succeeded and therefore I downloaded the current version for various OS, and you can download them from these links.

1.Win32

2.Win64

3.Linux

4.Mac Oc

 

You can read more about this and other firmware methods here: https://github.com/stm32duino/wiki/wiki/Upload-methods#stm32cubeprogrammer.

There is also an interesting video:


Some features of Blue Pill pins.

 

Be careful with the PA11 and PA12 pins – this is USB, if something goes wrong, then in addition to losing the ability to flash the MK via usb, you can also damage the computer.

An external quartz clock (32.768) is connected to pins PC14 and PC15.

Other pins can deliver a maximum of 20mA, 8mA is recommended. The total maximum load must not exceed 150mA.

Despite the fact that the supply voltage is ~ 3V, half of the “legs” are tolerant of five volts. Which of course greatly facilitates the use of various peripherals.

The PC13 LED (which the D13 arduino has) is turned on not by a plus, but by a minus. This is just in case, so that you do not experience cognitive dissonance when you write – digitalWrite (PC13, HIGH), and the diode goes out

The MK does not have an EERPOM, but this is solved by connecting an external flash drive via I2C or SPI.

 


Connecting the programmer (UART)

 

Connecting the W550

STM32 W5500
PA4 CS
PA5 SCK
PA6 MISO
PA7 MOSI
3.3V VCC
GND GND

 


Features of using Serial0.

Since Serial0 in STM32 is connected to USB, USB support must be enabled as “Generic Serial” in order to use it when flashing the controller.

Otherwise, when compiling, if Serial0 is used, an error will be generated. By default, when using the description integrated into the FLProg program, these settings are used.

 


Additional files that may be required:

  1. Flash Loader Demonstrator
  2. Maple DFU Bootloader firmware binary (generic_boot20_pc13.bin)
  3. Drivers for Maple (Windows)
  4. Drivers for Maple (Windows)

0

Publication author

758
Comments: 15Publics: 389Registration: 04-02-2018

3 thoughts on “Using STM32F103C8 (Blue Pill) Controllers with Arduino IDE”

  1. Здравствуйте Сергей.

    Спасибо что вы есть , что мы вместе (хотя наши взгляды  на жизнь различаются),  думаем об одном , но с разной степенью технических и интеллектуальных способностей, а значит и возможностей. В данное время вы  пополняете базу контроллеров необходимых для  управления различными системами управления и автоматизации.

    Я к вам обращаюсь как пользователь вашей программой FLProg. В данное время разрабатываю проект солнечного трекера который будет  с  помощью шагового двигателя осуществлять поворот  солнечной панели в соответствии со скоростью движения солнца. До этого  мной трекер был сделан  на сервоприводе . Сервопривод оказался не надежным механизмом(не дешёвый,20кг,медные шестерни), ввиду отсутствия устойчивости панели при наличии ветровой нагрузки. Эффективность поворотной солнечной панели превзошла стоящую до нее стационарную панель на 40%.

    Когда я  решил перейти на шаговый двигатель (NEMA 17)  то обнаружил недостаток . Во встроенных блоках нет  блока который отвечал бы за мой контроллер.

    Конечно я пробовал  подключать пользовательский блок. Но  в моем контроллере WEMOS mini  напихано очень много функций по отслеживанию заряда каждой из шести батарей  по WI-FI удаленно через облако Каскады.

    Не могли бы вы после завершения ваших планов, добавить блоки для управления драйверами шаговых двигателей? В частности у меня драйвер A4988.

    Здоровья вам и новых идей!

    0

Leave a Comment

Войти с помощью: