Posts

Beginner's Guide to STM32CubeMX

Image
STM32 CubeMx tutorial Introduction Welcome to this STM32 Cube Mx tutorial. You might be wondering what is it all about? Don’t worry you will find the answers here. STM32 Cube Mx is a free software provided by ST Microelectronics who builds the STM32 line of micro controllers. One issue with these devices is that a lot of code needs to be written to initialize the device. The STM32 Cube Mx is a GUI that makes life much easier. It helps reduce the burden regarding initializing the micro controller. Bear in mind though that it will not write the code regarding the operation you want to make. Lets take an example, suppose I want to use a STM32F100VGT6 and blink an external LED. The STM32 Cube Mx will help me get the micro controller setup and get an output port ready for me. Unfortunately it will not tell the micro controller that I want to blink the led and at what speed I want the LED to blink. I have however given a small glimpse on how to turn switch on an output port at...

Beginner's Guide to PIC Microcontrollers

Image
Introduction to PIC Microcontrollers Introduction PIC Microcontrollers have been the very first microcontrollers I worked with. I started with the venerable 16F84 and I have worked with a lot of other PIC devices since then. The aim here like my other posts is to give an idea of the implication of working with such devices. So basically what is a PIC Microcontroller, well its another microcontroller available on the market made by Microchip. PIC Microcontrollers are available in a wide variety of offerings namely 8bit, 16 bit or also called DSPIC and 32 bit. Don't get scared here on the number of bits they are actually the size of instruction that the microcontrollers can process. 8bit microcontrollers are out there and performing very complicated tasks. Microchip enhances all their portfolio offerings regularly to make sure their microcontrollers keep up to the job. From a hobbyist point of view there seems to be some models which are very popular mainly the through hole p...

Writing code for the STM32

Writing Code for the STM32F Introduction Following my previous post on setting a project and all the necessary files for an STM32F, I will now guide you to setup the code that needs to be written. In case you get lost in the steps below please refer to the following post Introduction to STM32F   All the code will be placed in the files which were created in Introduction to STM32F  will be reused here. Before we start writing any code, first you need to understand how everything will be structured. Below is a summary of how the code will be organized:   Preparing to write the code In order to code the STM32F C programming language will be used. In C programming language we don't write all the code in a continuous set of lines in a single file. This makes the code difficult to maintain and re-use. The proper way to proceed is to first decide what the microcontroller needs to do. For this post I will keep things simple I just want to make pin PB8 an out...