In this Arduino STM32 Tutorial, we are going to take a first look at the STM32 Arduino Compatible Board. This board is powerful and inexpensive. Let’s see what it has to offer!

Intro to theĀ Arduino STM32 Tutorial

Hello, guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266 and other popular boards. Today I am very excited because we are going to test this new board which uses the STM32 chip and we are going to learn how to program it using the Arduino IDE. As you can see, I have connected one of my favorite displays; the 1.8ā€ Color TFT display and I have loaded the graphics test program. From this test, you can tell that the board is fast! Letā€™s now take a closer look at the board!

I discovered this little board some time ago when cmb80amiga, a long time viewer of the channel suggested that I should give it a try. After watching some of his impressive projects with this board on his YouTube channel, I decided to buy one to try it. You can visit his channel by clicking on this card. The board costs around 3$.

——————–
WHERE TO BUY
——————–

STM32 Board:Ā https://educ8s.tv/part/STM32

FTDI Programmer: https://educ8s.tv/part/FTDI

Color TFT: https://educ8s.tv/part/7735

Small Breadboard: https://educ8s.tv/part/SmallBreadboard

Wires: https://educ8s.tv/part/Wires

Power Bank: https://educ8s.tv/part/Powerbank

Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!

[adsense]

The board I bought, which is also called the blue pill because of the blue color of the PCB, features the STM32F103C8T6 chip, which is powerful, ARM processor! The board is tiny. It is slightly bigger than the Arduino Nano board. Apart from the chip itself, on the board, we can find an 8Mhz Crystal and a 32KHz crystal to drive the internal Real Time Clock. The board uses 3.3V logic levels, but most of its pins are 5V tolerant. Letā€™s now take a closer look at the heart of the board the STM32 chip.

The chip is a 32bit ARM processor which is clocked at 72MHz! The chip does not offer WiFi or Bluetooth, but it offers, 20KB of RAM and 64KB of Flash memory which is enough to build large projects. It also provides 37GPIO pins, 10 ADC pins, SPI, I2C, CAN, UART buses and a DMA controller. These are impressive specs for a chip that costs 3$. If we compare the specs of the STM32 with the specs of the Arduino Uno, we can see that this small board outperforms the Arduino Uno in every field. The frequency at which the STM32 chip operates is 4.5 times higher than the frequency that the Arduino Uno operates. So, we expect the STM32 to be at least 4.5 times faster than the Arduino Uno.

To find out if this is the case, I created a simple benchmark. Both boards must calculate the Pi with the same algorithm for the same number of iterations of the Algorithm. I have connected a 1.8ā€ Color TFT display to show the results. As you can see the STM32 board needed 3.8 seconds to perform this task. The Arduino Uno, on the other hand, needed 29,1 seconds. That means the STM32 is 7.6 times faster than the Arduino Uno in this example. The performance difference is huge! You can download the code of this simple benchmark from a link in the description of the video. Letā€™s now see how to upload programs to the board with the Arduino IDE.

——————–
Arduino ADD ON LINK
——————–

http://dan.drown.org/stm32duino/package_STM32duino_index.json

How to program the STM32 Board

In order to use the board with the Arduino IDE, we need to install some packages. Go to File -> Preferences and enter this URL here and press OK. Now go to Tools -> Board and open the boards Manager. Search for STM32F1 and install the package that appears! The installation procedure will take a few seconds. After that, all you have to do is to select your board. Under the Tools Menu again, we choose the Generic STM32F103C board, for the Upload method we select serial, and lastly, we choose the port that the STM32 board is connected to. Now we are ready to upload our first program to it! We open the standard blink sketch. All we have to do is modify this sketch like this.

The LED on STM32 board is connected to pin PC13 so after this small change we press upload! A few seconds later the LED starts blinking! We can reprogram the board if we wish, by pressing the RESET button once more. When we are finished, we set the jumper back to position 0. Now we can remove the FTDI module and power the board from the USB input. The board will start executing the code we just uploaded. If you power the board and the program is not running, be sure that you have remembered to switch the jumper back to its original position. The current that the board draws when running the blink sketch is around 40mA but it can be reduced if you put the processor to sleep, something I havenā€™t tried yet. If any of you has more information about it, please share it in the comments below.

Final Thoughts

Now that we know how to use this board, we have another great tool in our toolset. The STM32 board is an extremely powerful board and useful board even though it does not offer WiFi or Bluetooth. It can replace the Arduino Nano on many projects that we need more program memory or better refresh rates on big displays. Since there is a very active community around this board, we can find libraries for most of the displays and the sensors we are using. So if you need a small but powerful board with many IO capabilities, the STM32 board will probably fit your needs. I would love to hear your opinion on this board and your experience with it. Are you going to build any projects around this board? Please, post your comments in the comments section below!

——————–
CODE
——————–

 

 

 

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv