Blinking leds on PortA and PortB - ATmega163
2005-05-14 by acemailone
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2005-05-14 by acemailone
I'm trying to blink some leds using an ATmega163. I have one led on PORTB.0 that goes to GND through a 4k7 resistor. This one works fine. A second led on PORTA.0 going to GND doesn't blink. If I connect it to VCC, then is blinking. I checked the datasheet of ATmega163 and I didn't see any difference for ports A and B when they are configured as general I/O. What could be the explanation? Adrian
2005-05-14 by Larry Barello
Do you have AVCC connected to +5v?
-----Original Message----- From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]On Behalf Of acemailone Sent: Friday, May 13, 2005 8:12 PM To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Blinking leds on PortA and PortB - ATmega163 I'm trying to blink some leds using an ATmega163. I have one led on PORTB.0 that goes to GND through a 4k7 resistor. This one works fine. A second led on PORTA.0 going to GND doesn't blink. If I connect it to VCC, then is blinking. I checked the datasheet of ATmega163 and I didn't see any difference for ports A and B when they are configured as general I/O. What could be the explanation? Adrian Yahoo! Groups Links
2005-05-15 by wbounce
You resistor value seems high. I use a 300 - 330 ohm resistor because a led needs 15 mAmps. Ie 5V/330 = .015 amps
-----Original Message----- From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of acemailone Sent: Friday, May 13, 2005 11:12 PM To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Blinking leds on PortA and PortB - ATmega163 I'm trying to blink some leds using an ATmega163. I have one led on PORTB.0 that goes to GND through a 4k7 resistor. This one works fine. A second led on PORTA.0 going to GND doesn't blink. If I connect it to VCC, then is blinking. I checked the datasheet of ATmega163 and I didn't see any difference for ports A and B when they are configured as general I/O. What could be the explanation? Adrian Yahoo! Groups Links
2005-05-15 by Mike Murphree
On May 14, 2005, at 8:26 PM, wbounce wrote: > You resistor value seems high. > I use a 300 - 330 ohm resistor because a led needs 15 mAmps. Ie 5V/ > 330 > = .015 amps There are a number of LEDs that will work fine on 2 mA. Also don't forgot to subtract the forward voltage drop of the LED from the supply voltage when calculating current. Mike
2005-05-15 by acemailone
Larry I didn't have AVCC connected. Now it is OK. Thanks for the hint. I'm new with AVR's so that's why I miss things. With PICs I didn't hit this kind of problem. Adrian Larry Barello wrote:
> Do you have AVCC connected to +5v? > > -----Original Message----- > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]On > Behalf Of acemailone > Sent: Friday, May 13, 2005 8:12 PM > To: AVR-Chat@yahoogroups.com > Subject: [AVR-Chat] Blinking leds on PortA and PortB - ATmega163 > > > I'm trying to blink some leds using an ATmega163. I have one led on > PORTB.0 that goes to GND through a 4k7 resistor. This one works fine. > A second led on PORTA.0 going to GND doesn't blink. If I connect it to > VCC, then is blinking. > I checked the datasheet of ATmega163 and I didn't see any difference for > ports A and B when they are configured as general I/O. > What could be the explanation? > > Adrian > > > > > Yahoo! Groups Links > > > > > > > > > ------------------------------------------------------------------------ > *Yahoo! Groups Links* > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/AVR-Chat/ > > * To unsubscribe from this group, send an email to: > AVR-Chat-unsubscribe@yahoogroups.com > <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > >
2005-05-15 by Dave VanHorn
At 08:26 PM 5/14/2005, wbounce wrote: >You resistor value seems high. >I use a 300 - 330 ohm resistor because a led needs 15 mAmps. Ie 5V/330 >= .015 amps You're off, but in a safe direction,. The actual formula is (Vin - Vled) / R so you end up with about (5 - 2) / 330 or 9mA, assuming a common red LED with approx 2V forward drop. As the wavelength gets shorter, the voltage gets higher, an unavoidable consequence of quantum mechanics.
2005-05-15 by Dennis Clark
Actually, wbounce wrote: > You resistor value seems high. > I use a 300 - 330 ohm resistor because a led needs 15 mAmps. Ie 5V/330 > = .015 amps I regularly use 1K, and figure the current as (5-1.7)/1000 which is about 3.3ma, more than enough for every LED I've ever used. DLC > -----Original Message----- > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On > Behalf Of acemailone > Sent: Friday, May 13, 2005 11:12 PM > To: AVR-Chat@yahoogroups.com > Subject: [AVR-Chat] Blinking leds on PortA and PortB - ATmega163 > > > I'm trying to blink some leds using an ATmega163. I have one led on > PORTB.0 that goes to GND through a 4k7 resistor. This one works fine. A > second led on PORTA.0 going to GND doesn't blink. If I connect it to > VCC, then is blinking. > I checked the datasheet of ATmega163 and I didn't see any difference for > > ports A and B when they are configured as general I/O. > What could be the explanation? > > Adrian -- --------------------------------------- Dennis Clark TTT Enterprises ---------------------------------------