External LED Blink Using STM32F401CE
by Arshdeep singh in Circuits > Electronics
33 Views, 0 Favorites, 0 Comments
External LED Blink Using STM32F401CE
Let's dive into the exciting world of embedded systems by learning how to make an LED blink using the STM32F401CE microcontroller. This microcontroller is a powerful yet accessible tool for creating all sorts of electronic projects.
we will blink an external LED, using STM32F401CE with HAL programming.
Supplies
- STM32F401CE
- LED 3V
- Jumper wires M-F
- C-type Cable
Open New File in STM32cubeIDE
Open STM32cubeIDE>>file>>New>>STM32project.
Configure Your STMcubeIDE
Select your stm board, after selecting rename it.
PIN Mode Selection
set the pin c14 for GPIO_output.
Pinout & Clock Configuration
System core>>RCC>>High speed clock(HSE)>>Crystal/ceramic Resonator.
In clock configuration fill the columns shown in the picture.
How to Open Code File
Now press ctrl+s to open codding file, After this the new code file will open.
Add the Code
HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);
HAL_Delay(1000);
HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);
HAL_Delay(1000);
write this code in while loop.
Building Binary File
Click on debug (On top left corner) to generate binary file.
Open STMCubeProgrammer and Connect With STM Board Via USB
Change ST-Link to USB and click on 'Connect'
Go to Download Options
Modify Download Options and Click on "Start Automatic Mode
Fill the all options shown in picture.