LED & Button connection
2006-05-26 by Иван Кончаловский
Yahoo Groups archive
Index last updated: 2026-04-28 23:31 UTC
Thread
2006-05-26 by Иван Кончаловский
Hello All. I have two questions for you: 1. Is it possible to connect LED (super bright 1mA) to port pin without additional current limiting resistor? 2. Is it possible to connect button between port pin and ground while configuring this port pin as output with high level and read its state (button pressed or not)? -- Best regards, Hummel
2006-05-26 by Leon Heller
----- Original Message -----
From: "\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd" <Hummel-80@...> To: <lpc2000@yahoogroups.com> Sent: Friday, May 26, 2006 4:14 PM Subject: [lpc2000] LED & Button connection > Hello All. > > I have two questions for you: > 1. Is it possible to connect LED (super bright 1mA) to port pin > without additional current limiting resistor? Of course you can do it, if you want! > 2. Is it possible to connect button between port pin and > ground while configuring this port pin as output with > high level and read its state (button pressed or not)? You can do that, as well! Read the data sheet. Leon --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ]
2006-05-26 by c.barbaro
--- In lpc2000@yahoogroups.com, Èâàí Êîí÷àëîâñêèé <Hummel-80@...> wrote: > > Hello All. > > I have two questions for you: > 1. Is it possible to connect LED (super bright 1mA) to port pin > without additional current limiting resistor? > 2. Is it possible to connect button between port pin and > ground while configuring this port pin as output with > high level and read its state (button pressed or not)? > > -- > Best regards, > Hummel > Are you an enemy of resistors? Nevertheless they aren't big or costly components...
2006-05-26 by Erick Damasceno
Has anyone succed porting lpcusb for keil mcb2140?? I tried many things but doesn't work. If anyone have succed, please, send me the code or tell me what i have to do. thanks, Erick --------------------------------- Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! [Non-text portions of this message have been removed]
2006-05-26 by Gus
I don't know what Leon is trying to do here but no you can't do that. If you know electronics well you will know why but if you are hobbyist then just follow the many examples and schematics out there. I agree you should read the data sheet but to newbies, data sheets are nightmares LOL Gus --- In lpc2000@yahoogroups.com, "Leon Heller" <leon.heller@...> wrote: > > ----- Original Message ----- > From: "Èâàí Êîí÷àëîâñêèé" <Hummel-80@...> > To: <lpc2000@yahoogroups.com> > Sent: Friday, May 26, 2006 4:14 PM > Subject: [lpc2000] LED & Button connection > > > > Hello All. > > > > I have two questions for you: > > 1. Is it possible to connect LED (super bright 1mA) to port pin > > without additional current limiting resistor? > > Of course you can do it, if you want! > > > 2. Is it possible to connect button between port pin and > > ground while configuring this port pin as output with > > high level and read its state (button pressed or not)? > > You can do that, as well! > > Read the data sheet. > > Leon > > --- > [This E-mail has been scanned for viruses but it is your responsibility > to maintain up to date anti virus software on the device that you are > currently using to read this email. ] >
2006-05-26 by Leon Heller
----- Original Message -----
From: "Gus" <gus_is_working@...> To: <lpc2000@yahoogroups.com> Sent: Friday, May 26, 2006 5:58 PM Subject: [lpc2000] Re: LED & Button connection I don't know what Leon is trying to do here but no you can't do that. If you know electronics well you will know why but if you are hobbyist then just follow the many examples and schematics out there. I agree you should read the data sheet but to newbies, data sheets are nightmares LOL He asked if he could do it. The point I was making was that he could if he wanted to, but if he read the data sheet he'd see that it wasn't advisable. Leon --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ]
2006-05-26 by newmanrf@originarea.com
Hummel,
These guys are pulling your leg. That means they are teasing you for
not knowing any better.
It is not eloquent to connect a led to a i/o pin without a resistor if
your pin can source or sink more current than your device can
withstand and survive. Yes it will work for a while but then either
your led or your pin driver will fail so no you should not do it.
If your led only takes 1mA, and that seems really small to me normally
leds take 20ma (0.020A), then use the formulas you learned in school
to determine your resistor. In this case you use R=V/I where R is the
resistor resistance your looking for and V is your power supply
voltage that the CPU which you are attaching your led is attached to
one of its i/o pins and I is the current which your thing needs to run
correctly which in this case is a led that takes 20ma or 0.020A. So
the formula 3.3vdc / 0.020A gives us 165 Ohms and in my box of parts
I have 220 Ohms so I pick that and use it which makes the led work but
just a little less dim than had I had 150, 160 or 180 Ohm resistors.
So this answers your led question and here is a web page that talks
about other related subjects which your probably going to need to know
also:
http://www.music.columbia.edu/~douglas/classes/microcontrollers/part3.html
If I were you I would start at the beginning of that class web page and
read the whole thing through, its good stuff and the basics are important.
I hope this helped you and if you have any additional questions which
the link above did not address or you need clarification simply post
another follow up question.
Richard Newman
Pittsburgh PA USA2006-05-26 by rtstofer
--- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@...> wrote: > > I don't know what Leon is trying to do here but no you can't do > that. If you know electronics well you will know why but if you are > hobbyist then just follow the many examples and schematics out there. > > I agree you should read the data sheet but to newbies, data sheets > are nightmares LOL > > Gus > Leon is correct! For a short period of time... According to the LPC2141_42_44_46_48 Datasheet, Iohs (HIGH-state short-circuit current is -45 mA and note 8 applies. Note 8 says "Only allowed for a short time period." So, it can be done. It is a poor idea and I wouldn't do it even if I could limit the time period. But the correct answer to the question is yes, it can be done. I would have to dig deeper to resolve the LED issue. I have seen it done with multiplexed displays and I have done it myself. It works ok. But, I don't have to guarantee my work. As to the issue of reading datasheets - if you don't understand the numbers, ask. Somebody will be able to help. Every number in the datasheet serves to limit the way in which the device may be applied. and is included for that specific reason. A more important question is why anyone would want to short the output. It just seems wrong, somehow. Even for a short period of time... Richard
2006-05-26 by Tom Walsh
rtstofer wrote: >--- In lpc2000@yahoogroups.com, "Gus" <gus_is_working@...> wrote: > > >>I don't know what Leon is trying to do here but no you can't do >>that. If you know electronics well you will know why but if you are >>hobbyist then just follow the many examples and schematics out there. >> >>I agree you should read the data sheet but to newbies, data sheets >>are nightmares LOL >> >>Gus >> >> >> > >Leon is correct! For a short period of time... > >According to the LPC2141_42_44_46_48 Datasheet, Iohs (HIGH-state >short-circuit current is -45 mA and note 8 applies. Note 8 says "Only >allowed for a short time period." So, it can be done. > >It is a poor idea and I wouldn't do it even if I could limit the time >period. But the correct answer to the question is yes, it can be done. > >I would have to dig deeper to resolve the LED issue. I have seen it >done with multiplexed displays and I have done it myself. It works >ok. But, I don't have to guarantee my work. > > > That depends on the driver used, some of those multiplexed dot matrix driver chips have internal current limiters and can withstand a dead short. This is unlike a CPU port pin, the short-circuit current spec is typically for ATE testing purposes. Understanding that spec can assist you in debugging a logic problem, watch the signal on a 'scope and then tap it with a voltage lead to see if it moves type of thing (e.g. "is this shorted to ground?"). Having said that, you can eliminate current limiting resistors if you "pop" (pulse) current into the LEDs. I'm sure that a steady state drive would fry the LEDs, though you can "hit" them with a pulse of current designed to make them "ignite" and remove the current before the internal junction temp gets too high. It does mean that you have to read the datasheet and understand the parameters of the parts. TomW -- Tom Walsh - WN3L - Embedded Systems Consultant http://openhardware.net, http://cyberiansoftware.com "Windows? No thanks, I have work to do..." ----------------------------------------------------
2006-05-26 by Tom Walsh
newmanrf@... wrote: >Hummel, > > These guys are pulling your leg. That means they are teasing you for >not knowing any better. > > It is not eloquent to connect a led to a i/o pin without a resistor if >your pin can source or sink more current than your device can >withstand and survive. Yes it will work for a while but then either >your led or your pin driver will fail so no you should not do it. > > > Something that I did not realize from the LED datasheets, until I did a dot matrix display bar, was that LEDs have a max current and a max voltage rating (breakdown voltage). That breakdown voltage is surprisingly small! IIRC, the VF parameter is the maximum voltage across the LED junction, exceeding that value will cause the junction to be punctured. If you think of the LED as a current device and use series limiting resistors, you are ok. This is because the resistor soaks up some of the voltage in the loop (kirchoff's law). When you "burn out" an LED due to too small a resistor, it becomes a question of did you apply too much current and overheated the junction -- OR -- did you overvoltage the junction? I typically calculate the VF (voltage across the junction) to be within 80% of the rating, then subtract that voltage from the applied voltage of the circuit. Once I have that "excess voltage", I then calculate the resistance needed to "soak" up that excess votage. TomW -- Tom Walsh - WN3L - Embedded Systems Consultant http://openhardware.net, http://cyberiansoftware.com "Windows? No thanks, I have work to do..." ----------------------------------------------------
2006-05-26 by rtstofer
--- In lpc2000@yahoogroups.com, newmanrf@... wrote: > > > Hummel, > > These guys are pulling your leg. That means they are teasing you for > not knowing any better. Not at all! I wouldn't do that... The question re: shorting the output was VERY specific and implied the knowledge that such a thing was NOT a good idea. I answered the question directly from the datasheet - YES, you can do it "for a short period of time". But I did go to the trouble to look it up instead of blowing it off. Mostly because Leon had said it was possible and, therefore, he had read something I had missed and I wanted to know what it was. Seems I am always playing catch-up! I also pointed out that I wouldn't personally do it, even if I could control the time. Richard
2006-05-26 by Leon Heller
----- Original Message -----
From: "rtstofer" <rstofer@...> To: <lpc2000@yahoogroups.com> Sent: Friday, May 26, 2006 8:02 PM Subject: [lpc2000] Re: LED & Button connection > --- In lpc2000@yahoogroups.com, newmanrf@... wrote: >> >> >> Hummel, >> >> These guys are pulling your leg. That means they are teasing you for >> not knowing any better. > > Not at all! I wouldn't do that... > > The question re: shorting the output was VERY specific and implied the > knowledge that such a thing was NOT a good idea. > > I answered the question directly from the datasheet - YES, you can do > it "for a short period of time". But I did go to the trouble to look > it up instead of blowing it off. Mostly because Leon had said it was > possible and, therefore, he had read something I had missed and I > wanted to know what it was. Seems I am always playing catch-up! > > I also pointed out that I wouldn't personally do it, even if I could > control the time. I did check the data sheet myself before my somewhat tongue in cheek response. The OP did look a bit like trolling to me. Leon --- [This E-mail has been scanned for viruses but it is your responsibility to maintain up to date anti virus software on the device that you are currently using to read this email. ]
2006-05-27 by unity0724
Umm... Cool down... guys... that heat generated here is enough to burn the 2pcs tiny 0603 resistors.... :) Everyone is right! - You should be able to pulse high the pin for few uS and read the switch status. - You can pulse LED at about 40-100mA. Typical rated current for LED is 20mA I think everybody here will not "intentionally" want to remove those 2 resistors. May be as some "quick fix" for some mistakes in design after PCB fabricated... Also, if you must do it... do it on some LPC 4-5mA MOS output driving pins and not some AVR 20-30mA type Regards --- In lpc2000@yahoogroups.com, "Leon Heller" <leon.heller@...> wrote: > > ----- Original Message ----- > From: "rtstofer" <rstofer@...> > To: <lpc2000@yahoogroups.com> > Sent: Friday, May 26, 2006 8:02 PM > Subject: [lpc2000] Re: LED & Button connection > > > > --- In lpc2000@yahoogroups.com, newmanrf@ wrote: > >> > >> > >> Hummel, > >> > >> These guys are pulling your leg. That means they are teasing you for > >> not knowing any better. > > > > Not at all! I wouldn't do that... > > > > The question re: shorting the output was VERY specific and implied the > > knowledge that such a thing was NOT a good idea. > > > > I answered the question directly from the datasheet - YES, you can do > > it "for a short period of time". But I did go to the trouble to look > > it up instead of blowing it off. Mostly because Leon had said it was > > possible and, therefore, he had read something I had missed and I > > wanted to know what it was. Seems I am always playing catch-up! > > > > I also pointed out that I wouldn't personally do it, even if I could > > control the time. > > I did check the data sheet myself before my somewhat tongue in cheek > response. The OP did look a bit like trolling to me. > > Leon > > --- > [This E-mail has been scanned for viruses but it is your responsibility > to maintain up to date anti virus software on the device that you are > currently using to read this email. ] >
2006-05-29 by Иван Кончаловский
Hello All. > I have two questions for you: > 1. Is it possible to connect LED (super bright 1mA) to port pin > without additional current limiting resistor? > 2. Is it possible to connect button between port pin and > ground while configuring this port pin as output with > high level and read its state (button pressed or not)? First of all thanks to everybody for your answers. Secondly i am not a newby in electronics and MCUs (as i think). So why i was asking this question? Lately i worked with PIC18 MCU, as you probably know it has port B with internal pull-up resistors. I use to connect buttons and LEDs to it without any resistors (of course). In Philips` datasheets i found no port schematics and decided to ask in this conference. -- Best regards, Hummel
2006-05-29 by c.barbaro
Hi, I don't know the the PIC18 port hardware details but, regarding your question 2, why configure the port pin as output? Usually the switch is connected between the pin and gnd, the pin is an input and you read high when switch is off and low when switch is on. Regarding the LED, I can't easily imagine how it is connected: is it lit by the CPU internal pullup resistor and turned off driving the port pin low? The processors in LPC family have some pins open collector (see the I2C interface pins), but unfortunately no internal pullup resistor. Best regards --- In lpc2000@yahoogroups.com, Èâàí Êîí÷àëîâñêèé <Hummel-80@...> wrote:
> > > Hello All. > > > I have two questions for you: > > 1. Is it possible to connect LED (super bright 1mA) to port pin > > without additional current limiting resistor? > > 2. Is it possible to connect button between port pin and > > ground while configuring this port pin as output with > > high level and read its state (button pressed or not)? > > First of all thanks to everybody for your answers. > > Secondly i am not a newby in electronics and MCUs (as i > think). So why i was asking this question? Lately i worked > with PIC18 MCU, as you probably know it has port B with > internal pull-up resistors. I use to connect buttons and > LEDs to it without any resistors (of course). In Philips` > datasheets i found no port schematics and decided to ask in > this conference. > > -- > Best regards, > Hummel >