External LED Blink Using STM32F401CE

by Arshdeep singh in Circuits > Electronics

33 Views, 0 Favorites, 0 Comments

External LED Blink Using STM32F401CE

Screenshot 2024-04-09 175711.png

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

Screenshot 2024-04-09 181002.png
Screenshot 2024-04-09 180854.png
Screenshot 2024-04-09 180824.png
Screenshot 2024-04-09 181133.png
  1. STM32F401CE
  2. LED 3V
  3. Jumper wires M-F
  4. C-type Cable

Open New File in STM32cubeIDE

Screenshot 2024-03-12 150750.png

Open STM32cubeIDE>>file>>New>>STM32project.

Configure Your STMcubeIDE

Screenshot 2024-03-12 151107.png

Select your stm board, after selecting rename it.

PIN Mode Selection

Screenshot 2024-04-09 182651.png

set the pin c14 for GPIO_output.

Pinout & Clock Configuration

Screenshot 2024-04-09 183805.png
Screenshot 2024-04-09 183823.png

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

Screenshot 2024-04-09 184535.png

Now press ctrl+s to open codding file, After this the new code file will open.

Add the Code

Screenshot 2024-04-09 184822.png

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

Screenshot 2024-03-12 160000.png

Click on debug (On top left corner) to generate binary file.

Open STMCubeProgrammer and Connect With STM Board Via USB

Screenshot 2024-04-09 185612.png

Change ST-Link to USB and click on 'Connect'

Go to Download Options

Screenshot 2024-03-15 111912.png

Modify Download Options and Click on "Start Automatic Mode

Screenshot 2024-04-09 190221.png

Fill the all options shown in picture.

Final Step

Screenshot 2024-04-09 190420.png