cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407VET6 LED glowing in input mode

anjaly
Associate
Posted on July 01, 2016 at 06:24

I am using STM32F407VET6 board.I wants to ON and OFF LED using GPIO(PORT B & PIN 8). It is 5V tolerant . I reset the gpio and glow the led .But when I set gpio in INPUT mode still LED glowing.It is 5V tolerant.Why?

#gpio #stm32f407 #led
3 REPLIES 3
Danish1
Lead II
Posted on July 01, 2016 at 13:20

From what I understand, STM32F407VET6 identifies a processor, not a board.

Your board might connect port B pin 8 to some other circuitry and that might be where the current is flowing (rather than the processor) which causes the LED to glow. As

we

don't know what test board you are using, we can't rule that out as a possibility.

Other thoughts:

You say you program the pin to be an input (and the LED still glows). If you program the pin to be an ANALOG input, or an input with either PULL_UP or PULL-DOWN, I would expect it to draw current when you pull it externally above Vdd.

Another possibility is if your code is not keeping the pin as input-floating. If you have it output for even 1 microsecond every few milliseconds then that will be enough to make the LED look as though it is glowing continuously. If you stick in an endless loop after programming the pin to be input-floating then you can be more confident that the remainder of your code is not defeating your current test.

What voltage do you measure on the pin? (And how does that compare to the processor's Vdd).

Do you have access to an oscilloscope so you can see if the voltage is stable rather than pulsing?

Hope this helps,

Danish

Posted on July 01, 2016 at 15:54

The pin drivers are still powered by 3.3V, and both 3.3V and 0V are below 5V, some current is probably likely to flow.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Danish1
Lead II
Posted on July 04, 2016 at 10:45

The data sheet shows a maximum Ilkg of 3 uA flowing into a five-volt-tolerant pin when programmed as input with no pull-up and no pull-down.

I'm not sure if that is enough to cause an LED to glow.

 - Danish