Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Driving Led with GPIO pin.

Status
Not open for further replies.

alphadog

Banned
Hello.

I have a led which consumes 20mA @ 2.5V , and my GPIO pin can provide 20mA @ 3.3V, so theoritcally i can drive the LED with this pin.
Currently its driven by BJT that is opened/closed by that GPIO pin (but i want to spare that BJT).
The problem is that i'm not sure what is the VIH of my MCU.
I'm working with CC2430 and i read its datasheet, so probably i already read this data but didnt interept it right.
Is it the:
"DVDD Power (Digital): 2.0V-3.6V digital power supply for digital I/O" ?

Here is its datasheet if you already know what term to look for:
https://focus.ti.com/lit/ds/symlink/cc2430.pdf

Thanks!
 
I couldn't find it on there. Usually Voh or something. Just figure it's near the supply voltage and use a 47Ω resistor.
 
I was thinking about it too, but isnt it risky to drive LED with GPIO pin?
Its VOH can be much lower than the 'HIGH' level, therefore the LED wont light as you would want it to if PIN's HIGH is VOH, isnt it?
 
Not risky. Your current spec is the main concern, and you said it was good for 20ma, right? You confident on that current spec? It's enough to light an indicator LED.

Yes, the output high level voltage will probably be a couple two or three tenths of a volt shy of the rail, but so what? That just decreases the current, if you figure the resistor based on the supply V - led forward drop V. 47Ω puts you below the danger zone off a 3.3V supply.

GPIO is general purpose I/O, equivalent of a parallel port. It's there to run things like this.
 
There is only to outputs that can drive 20ma that is P1_0 and P1_1 the rest can only drive
4 ma it's in the datasheet on page 78 you better look at that. before you kill your chip.
 
Not risky. Your current spec is the main concern, and you said it was good for 20ma, right? You confident on that current spec? It's enough to light an indicator LED.

Yes, the output high level voltage will probably be a couple two or three tenths of a volt shy of the rail, but so what? That just decreases the current, if you figure the resistor based on the supply V - led forward drop V. 47Ω puts you below the danger zone off a 3.3V supply.

GPIO is general purpose I/O, equivalent of a parallel port. It's there to run things like this.

But what about continuous current of 20mA?
I havent found in datasheet anything about the MCU's capability of driving 20mA for long period of time.
Do you know anything about a problem that continuous current might cause?
 
Like I said page 78 of the datasheet only 2 pins can drive 20 ma
The rest is 4ma the pins that can drive 20ma is P1_0 and P1_1 the rest can only drive
4 ma
 
Last edited:
How can you tell that?
All i saw is that:
-"Port 1.1 – 20 mA drive capability"
-"Port 1.1 – 20 mA drive capability"
- "The output drive strength is 4 mA on all outputs, except for the two high-drive outputs, P1_0 and P1_1, which each have 20 mA output drive strength."
- "21 general I/O pins, two with 20mA sink/source capability"
 
The output drive strength is 4 mA on all
outputs, except for the two high-drive outputs,
P1_0 and P1_1, which each have 20 mA
output drive strength
that's on page 78
 
And this to if it helps
21 general I/O pins, two with 20mA sink/source
capability
All low power 8051 chips I have seen use driver chips to power leds and such
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top