I just plugged the regulator circuit into LTSpice, I think I am starting to see what the problem might be. Without the LED, I get an output of 5.2v at ~120mA. When I add the LED, voltage drops to 4.7v at ~80mA.
I just plugged the regulator circuit into LTSpice, I think I am starting to see what the problem might be. Without the LED, I get an output of 5.2v at ~120mA. When I add the LED, voltage drops to 4.7v at ~80mA.
The eye responds to peak brightness; by varying the LED duty cycle and using a big enough cap and a small enough series resistor you can probably fix this problem without dropping the perceived brightness.
The eye responds to peak brightness; by varying the LED duty cycle and using a big enough cap and a small enough series resistor you can probably fix this problem without dropping the perceived brightness.
120mA sounds like a lot for a micro with two LEDs (unless I'm missing something here).
I presume you've checked for shorts, miswiring etc?
Other than that I'd suggest looking at the program and checking if there are peripherals enabled that shouldn't be. For example with a PIC if you have enabled analog input for a digital output you'll get a serious power drain like this, perhaps even damage the chip.
Not sure about ATMEL. I note in your cct your LED output is connected to pin AIN0.