Tutorial/blog to Get Start With STM32 Black Pill and STM Cube IDE to Blink External LED Using HAL Programming.
by ayush4514be23 in Circuits > Electronics
145 Views, 0 Favorites, 0 Comments
Tutorial/blog to Get Start With STM32 Black Pill and STM Cube IDE to Blink External LED Using HAL Programming.
The STM32 Black Pill board is a low-cost, high-performance microcontroller board that is widely used in embedded systems. The board is based on the powerful STM32F103C8T6 microcontroller, which is part of the STM32 family of microcontrollers.
Supplies
- STM 32 BOARD
- USB TYPE C CABLE
Installing STM32 Cube Ide
Step 1: Installing STM 32 Cube IDE
Download the STM 32 cube IDE in order to perform this task
The file can be downloaded from the following link:
https://github.com/eziya/STM32_HAL_I2C_HD44780/blob/master/Src/liquidcrystal_i2c.h
Making the File
As we head into programming in the CUBE IDE head over to the top left and create a new STM32 project by clicking on "FILE" and then "NEW" then after on new "STM32 Project"
Downloads
Setting Pin Configuration
Once the file is created select the required STM board and then after set the pin configuration as shown.
(In this task we set the pin 13 as the required pin because in the STM board pin 13 is built in LED)
Downloads
Clock Configuration
In any synchronous circuit, clock frequency plays an integral part thereby we set the frequency as shown in order to execute the task.
Downloads
Generating the Code
One of the major advantages of using STM32 IDE is that the code is automatically adjusted according the the clock configuration and then we just have to make a little bit of changes using the required syntax.
Downloads
Using the Binary File
One of the tricky part is that we will require the binary file i.e. .elf file.
For that, we simply open the .elf file created in the system explorer by Right clicking on the project and clicking on show in system explorer and copying the path on the STM32Cube PROGRAMMER.
Downloads
Execution
In the last step we just need to connect the STM32 Board with the system and upload the code to get the required results.
Downloads
Result
inally after completing all the steps we will see that the LED on the STM board will blink with a delay of 1 second