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
Great Start with this chip. Will you be adding other tutorials?
I did as you instructed but I have nothing labeled under Port,just my Arduino and another line reading Bluetooth(which I know it is neither)what did I miss?
Based on your video I became intrigued with the STM32F103C8T6, so much so that I had purchased 5 do to its low cost. I look forward to see more videos on the blue pill when they become available.
Good Day Sir, I have two of these STM32F103C8T6 boards. I have built a 3D LED 3X3X3 Cube on breadboard connected to Arduino Uno R3. I want to connect to the STM32F103C8T6 bord, but am battling to find the compatable GPIO pins between the Arduino Uno R3 and the STM32F103C8T6 board. I am aware that I have to change some code to use the STM32F103C8T6 board. I just need to find the right GPIO pins to connect to STM32F103C8T6 board. The wiring is important, which is what I need. Can you assist me Sir? I have used this board yet, as I need the correct wiring to go from Arduino Uno R3 to the STM32F103C8T6 board
Hola amigo, me pareciĆ³ interesante tu articulo, pero que serĆa necesario modificar para usar la LCD de nokia
Love the videos and have been a long time subscriber on youtube! I am trying to use your sketch and I am just getting a white screen, any advice? I don’t have the software SPI pins (CLK and MOSI) hooked up because it appears you are using hardware SPI
For further info, I am using a ST7735 160×128 screen that works properly with arduino nano. The STM32f103c8tc works with a blinking led so I know that I can upload code to the board.
Never mind, I’m an idiot. Need the clk and mosi lines. It’s late and I am exhausted. Keep doing what you are doing, I absolutely love the videos! Keep them Coming.
problems between adafruit_gfx and adafruit_gfx_as: compilation errors
i can’t solve
i need help
thank you