2024-10-14 06:36 PM - last edited on 2024-10-15 09:05 AM by Andrew Neil
We want to turn on the LED when the microcontroller is powered on. Before the program is executed.
Is it possible to achieve this with just the program, without changing the HW?
Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.
Solved! Go to Solution.
2024-10-15 08:30 AM
@pass3master wrote:Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.
But that LED is not programmable: it is hard-wired to the 5V supply - there is no connection to the STM32:
https://www.st.com/resource/en/schematic_pack/mb1209-f412zgt6-d04_schematic.pdf#page=4
2024-10-14 07:10 PM
Hi,
Isn't that done with JP3...
Kind regards
Pedro
2024-10-14 09:25 PM - edited 2024-10-14 09:26 PM
Thank you for your answer.
Sorry for being st*pid. What does JP3 mean?
2024-10-14 10:18 PM
Look on STM32F412G-DISCO for JP3...
2024-10-14 10:25 PM
Is there a specific reason you want to turn on the LED before the STM32 is initialized and running?
A better approach is to blink the LED to indicate the FW is running and didn't hard fault.
2024-10-15 08:09 AM
You can connect one transistor with its input biased to turn it on, connect the base curcuit to one gpio. At boot time gpio is in input mode. When the program runs, you can turn off the transistor. Hope this helps. You can fine tune this idea with mosfet, optocoupler etc...
2024-10-15 08:30 AM
@pass3master wrote:Specifically, we want to program LD6(PWR) of STM32F412G-DISCO.
But that LED is not programmable: it is hard-wired to the 5V supply - there is no connection to the STM32:
https://www.st.com/resource/en/schematic_pack/mb1209-f412zgt6-d04_schematic.pdf#page=4
2024-10-15 08:12 PM
In the default design, LD6 is not programmable.
if you want to program LD6, the way is :
Step1: To remove R9.
Step2: To connect a GPIO(you can use resource from Arduino connector) to LD6 directly.
Step3: Program the GPIO you use.
Note that, brightness of LD depends on GPIO output capability.
2024-10-15 11:33 PM
Thank you for your response.
I see that the LED was coming directly from the 5V supply.
Now that I understand, I will close it.
2024-10-16 12:57 AM
@Sco wrote:Step2: To connect a GPIO (you can use resource from Arduino connector) to LD6 directly
Don't connect directly - connect via a suitable resistor!
eg 510 ohms is used for the other green LED: