STM32 Arduino Tutorial - How to use the STM32F103C8T6 board with the Arduino IDE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Dear friends welcome to another video! Today 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! 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. You can subscribe to our channel by clicking on this button. 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$, you can find a link to it in the description below. 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. First of all, to upload a program to the board, we need a USB to Serial module like this one which uses the FTDI chip. We connect Vcc from the module to the 5V pin of the board. Next, we connect GND to GND. Now we need to connect the RX pin of the module to pin A9 of the board and the TX pin of the module to pin A10 of the board. The last step we have to do is to place this jumper to position one, so the module to enter the program mode. We press the RESET button once, and we are ready. Let’s go to the computer now. 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. 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! If this is your first time here, I would love to have you subscribed. In this channel, I post videos about DIY projects twice a month. I love making things, and I believe that anyone can make things, anyone can become a maker. That’s why I created this channel, to share my knowledge with the community and learn from the community. I hope you will join us. I will see you in the next video! [ Translating these subtitles? Add your name here! ]
Info
Channel: educ8s.tv
Views: 288,962
Rating: undefined out of 5
Keywords: STM32, Arduino, STM32F103C8T6, Arduino STM32, STM32 Review, educ8s, educ8s.tv, stm32 tutorial, stm, STM32 Arduino Tutorial, STM32 ST7735, STM32 Color TFT, STM32 Benchmark, STM32F103C8T6 Arduino, Arduino Tutorial, STM32 tutorial, STM32 project, Arduino Project, Arduino ARM board, Arduino fast, Arduino VS STM32, STM32 Blink, STM32 Arduino IDE, FTDI Serial, STM32 Serial
Id: K-jYSysmw9w
Channel Id: undefined
Length: 7min 2sec (422 seconds)
Published: Sat Sep 30 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.