Introduction: 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

  1. STM32F401CE
  2. LED 3V
  3. Jumper wires M-F
  4. C-type Cable

Step 1: Open New File in STM32cubeIDE

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

Step 2: Configure Your STMcubeIDE

Select your stm board, after selecting rename it.

Step 3: PIN Mode Selection

set the pin c14 for GPIO_output.

Step 4: Pinout & Clock Configuration

System core>>RCC>>High speed clock(HSE)>>Crystal/ceramic Resonator.

In clock configuration fill the columns shown in the picture.

Step 5: How to Open Code File

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

Step 6: 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.

Step 7: Building Binary File

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

Step 8: Open STMCubeProgrammer and Connect With STM Board Via USB

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

Step 9: Go to Download Options

Step 10: Modify Download Options and Click on "Start Automatic Mode

Fill the all options shown in picture.

Step 11: Final Step