Sherif Beshr
Sherif Beshr

Reputation: 33

STM32 External LED blink

I am trying to Blink external LED using STM32CubeIDE and Proteus

     while (1)
  {
      HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
      HAL_Delay(100);
  }

STM Configuration [Proteus Blue Pill During Simulation)2

The LED doesn't blink

Upvotes: 0

Views: 3120

Answers (2)

Sherif Beshr
Sherif Beshr

Reputation: 33

The Problem Solved. First the polarity of the LED. Second the library of the blue pill on proteus doesn't support STM32FC103C8 that I selected on STM32CubeIDE. STM32FC103C6 should be selected instead.

Upvotes: 0

vision.io
vision.io

Reputation: 19

I am assuming that you have configured the pin to be output correctly with no pull up or pull down resistor. Hence you will need to terminate the LED into the ground instead of 3.3V.

In the event there is no pull up or pull down resistor, the pin is neither high or low, the pin is in a "z-state" hence when you toggle the LED from low to high there is no potential difference between the pin and the LED so no current flows, and when the pin goes from High to low, the diode property (only allows current flow in one direction) of the LED doesn't let current flow into towards the board.

Upvotes: 1

Related Questions