In the previous tutorials, I have shown how to use the simple GPIO and external interrupt of the STM32. Since these peripherals are connected with external pins, we can visually observe how it works through some LEDs of the Discovery kit. Therefore, it is very easy to know whether our code is working correctly or not. However, when you are playing with some kinds of internal peripherals such as Timer/Counter, UART,… with types of data are not bit anymore but byte or integer or float, you will need something else to diagnose that data. Typically, the programming environment like Keil or IAR provides us a debugging tool to debug those kinds of data in real time but I found they are not so convenient and user-friendly at all. So, to prepare for our next tutorials, which will be more about internal peripherals, I am going to introduce you to the STM Studio from STMicroelectronics.

Read More →

Last post we have figured out how to make the LED blink and learn some GPIO functions including: write, toggle and read. In this STM32F0 tutorial, we will learn how to configure, use GPIOs as external interrupt signal to trigger an LED without depending on main loop routine with CubeMX. We will:

  1. Understand some basic knowledge about interrupts of STM32F0
  2. Configure the STM32CubeMX project and synchronize files with Source Insight
  3. Test some code and see what we can do next with this Interrupt controller.

Read More →

STM32F0 tutorial blinking LED

In the first tutorial, I have shown some software that you needed to install to play with STM32F0.  This STM32F0 tutorial will straight forward show how to create a new blinking LED project for STM32F0 Discovery kit with STM32CubeMX and then, generate Keil ARM project and synchronize files with Source Insight. Through this specific example, we can learn how GPIO function of the STM32F0 works compared to other 8bit microcontrollers such as AVR or PIC. This tutorial will cover:

  1. Create new project using STM32CubeMX and export project folder and generate Keil ARM project file with all necessary libraries.
  2. Set up new Source Insight project, synchronize files. Edit the code, compile and load the program into the STM32F0 Discovery kit to test.
  3. Learn some basic knowledge on STM32F0 GPIO peripheral after testing the code.

It will take you less than 30 minutes to make your F0 Discovery board’s LED blinking when you follow this tutorial. So, let’s get started.

Read More →

Two weeks ago, I met my friend at Raspberry Jam SG #9 event and he introduced me about the Nuvoton competition organized in Singapore. While taking cab back together, we have had a very interesting conversation about our daily life and hobby. Then he mentioned about the Nuvoton competition where they give some NUC140 NuTiny boards for free, first for introducing new product and then, people can use that board for the competition prototype. The day after, I got the board from him to play with it.

Read More →

I have been working with STM32 microcontroller since 2012 until now and I found that it is a really good choice for both cost and performance. I have learned to use STM32F1 (Cortex M3) main stream at first and then discovered to F0 (Cortex M0) for over a year already.  The high performance, DSP-included STM32F4 is really powerful but actually, I don’t have any application that requires such power for now so I am still happy with the F0 and F1 stream. I found lots of tutorials about STM32F1 and F0 on the Internet and some of them are really in detail. Though, I found it quite challenging for some people as they don’t know how to start and face some problems with the coding part. So from my experience that I will share here in this tutorial series, I hope that you can find it useful and valuable. Most of my tutorial will base on application using peripherals of the microcontroller so that you can get the basic idea of what it is used for and I will keep it as simple as possible. I am also in the process of learning to use all of its capability and my knowledge about it is not perfect at all so that if I make some mistakes in this STM32F0 tutorial series, please give me a comment below the post. Besides, these tutorials in this series are not limited to F0 only, other types of STM32 microcontrollers can also be discovered by using the same method and libraries provided here.  So let’s get started.

Read More →