2023-04-28 02:21 AM
2023-04-28 02:35 AM
Then a small current flows, which may well cause the LED to glow. Unfortunately, you have not included any initialisation code, but I suspect that one of the internal pull resistors is switched on or that current is flowing externally. What does your hardware look like around the LED?
Regards
/Peter
2023-04-28 03:17 AM
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
|GPIO_PIN_4|GPIO_PIN_8|GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
The GPIO_PIN_15 connected to the LED is showing dim light on even though is reset.
2023-04-28 03:52 AM
And what about the hardware, i.e. the schematics around the LED?
How is it connected to the voltage?
2023-04-28 04:26 AM
You have NOPULL - It means can pick up noise. Try set GPIO_PULLDOWN for GPIO_InitStruct.Pull
2023-04-28 07:25 AM
WHAT??????? That is nonsense. The pin is defined as out push-pull output. It will drive high or drive low. Enabling the internal pull up or pull down will only draw more current.
2023-04-28 07:29 AM
You right . I mistake with open drain. Soooorrrry :)