By Abdul Rehman
We are going to create a LED Blink Program for stm32f103 microcontroller which comes with stm32 Bluepill development board which is cheap and handy to use. stm32 led blink program will help you to understand the basics of GPIO’s of STM32 platform and help you to understand some basics of using these GPIO as Output.
LED Blinking is considered the Hello world Program for any embedded development project. If you are using stm32 Cortex M series first time then this article is for you. Any Person who want to start any kind of microcontroller programming and want to understand the programming concept of that programming language will had to create first hello world program and in our case or in embedded development case the LED Blinking program.
This program will help us to understand following concepts required as a foundation of this cortex m series microcontrollers.
So lets just get started…
another good instructable on this topic could be found here
Creating our project in STM32 CubeMX
Thats all. Now You had successfully created your project go to the directory your told cubemx to save project into, and load your project in Keil uV4 or other compiler if you created for some compiler other then keil uVision 4.
Coding in Keil for stm32 LED blink
Now Open the project in Keil uVision 4 and goto Application/User and select main file
And finally these two lines will do rest of the magic
HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_9); //Toggle LED At GPIOB, pin9 HAL_Delay(1000); //Delay 1 Seconds
20 November 2022
13 November 2022
07 September 2022
27 July 2022
28 February 2022
FYP Solutions Powered By Impressive Business WordPress Theme