A simple led on new pcb will not working

We just got this pcb that we made, we are trying to turn on 4 leds, what happens is that they blink very fast and the light intensity is very limited (10%).

So the connections are :(328P tqfp, 8MHz, 3.3V regulated)

ATMEGA D3 - > +LED -> resistor 300ohm ->GND ATMEGA D4- > +LED -> resistor 300ohm ->GND ATMEGA B1- > +LED -> resistor 300ohm ->GND ATMEGA A7- > +LED -> resistor 300ohm ->GND

The software is :

void setup() {
   pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(A7, OUTPUT);

      digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(A7, HIGH);

}

 void loop() {

}

We have been able to program and they are blinking 10 times second very low intensity.

The current should be ok - 11mA for each led .

What could cause this blinking ?

Show the pcb? Show specs on led? Show wiring? Anything that would actually help?

Well , turns out that if I turn on only 2 leds, it works, any 2. But if I try to turn on 3 leds it won't work..

Am I crossing the limits? 300 ohm is 11mA, less then 40mA.

Does 40mA is also the maximum for all ports ? I could see that its 200mA .

Ok

Could they be blinking fast because you crash your 328P so it keeps rebooting?

ATMEGA B1- > +LED -> resistor 300ohm ->GNDWhat and where is this B1 pin ?

UKHeliBob: ATMEGA B1- > +LED -> resistor 300ohm ->GNDWhat and where is this B1 pin ?

I supposed that he is using 328P pin names and that B1 is portB, pin 15 of the component, which is Pin 9 in arduino IDE

D3 and D4 are PORTD and map to pin 3 and 4 in arduino IDE

I'm a bit more confused with A7, pin 22 of the 328P tqfp. Just a reminder that this TQFP package has 2 more ADC’s than the DIP package (P), but (Arduino) A6 and A7 are only analog inputs, they cannot be used for outputs – nor do they have any pull-ups on them...

Here you go from the doc page 4

1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only) In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels.

So you can't use A7 to drive your LED

J-M-L you right A6 can't be output, thats a mistake I know only now :) Thanks.

Well , it seems that its not only the leds, any other part that I connect will eliminate the leds from turning on, because it draw some current.

My only suspect, is that I use AMS1117 - so it gets 5v from usb, turn it onto 3.3v to the chip, but I haven't connected the capacitors on the output and input of the regulator(have to get them.)

Could this be the problem ? I really hope, because we paid a lot for this design..

Thanks guys.

Incomplete design not working as expected? Hold the phone.

gil22: J-M-L you right A6 can't be output, thats a mistake I know only now :) Thanks.

Well , it seems that its not only the leds, any other part that I connect will eliminate the leds from turning on, because it draw some current.

My only suspect, is that I use AMS1117 - so it gets 5v from usb, turn it onto 3.3v to the chip, but I haven't connected the capacitors on the output and input of the regulator(have to get them.)

Could this be the problem ? I really hope, because we paid a lot for this design..

Thanks guys.

Well sure better solder all the components and verify the connections before sending power into your custom board...

gil22: J-M-L you right A6 can't be output, thats a mistake I know only now :) Thanks.

Well , it seems that its not only the leds, any other part that I connect will eliminate the leds from turning on, because it draw some current.

My only suspect, is that I use AMS1117 - so it gets 5v from usb, turn it onto 3.3v to the chip, but I haven't connected the capacitors on the output and input of the regulator(have to get them.)

Could this be the problem ? I really hope, because we paid a lot for this design..

Thanks guys.

I suspected the regulator immediately. That suspicion wsa confirmed when you said 2 would work, but 3 or more didn't. Your code has them all constantly on, and there's nothing to crash the chip. The only other thing was your regulator crapping out, powering everything down, then recovering and starting over again.

If you paid a lot of money for a design that doesn't include caps on the regulator, you got ripped off. If they are in the design but you're powering it up without fully assembling it...why? Why would you think you're smart enough to judge what is and isn't important? Why are you asking us for help if you haven't even followed the instructions you were already given?

Yes. its the capacitor. wow, 10uF is actually making it work, and I don't deeply understand how it affect the closed loop of the regulator.