0
\$\begingroup\$

I am doing a hobby project working with a ATMega328, however, I am struggling with a with a small issue when I am trying to drive the output high on multiple pins at once. Somewhat new to this field, I am not 100% sure where to start debug.

The problem so far is. I have set up my arduino to program an ATMega using the internal clock. I have then uploaded my program using the arduino IDE to the uC. So far, everything looks good. The program itself is basically just setting some pins to output, and then high.

After this I move the uC to my breadboard, and measure the voltage on the output pins, and everything is dandy. All the output pins shows roughly 4.7V.

Now, I move the uC to my PCB ( I can upload the board and schematics somewhere if it helps ), but now when I measure the voltage on the pins, I see 0.120 or so volts on the same output pins.

Measuring the voltage coming in on the Vcc pins, I can see that it's well within the acceptable range. Somewhere around 4.9V.

Also, after some debugging, I have found that if I only enable ~2 pins, I can get the expected ~4V. However, if I enable 3+ output pins, I see the voltage drop.

I am somewhat confused, and new to this topic, so all suggestion would be useful. There seems to be something different between my PCB and breadboard configuration, and I am struggling a bit to debug where it goes wrong.

  • Edit:

The code for this is simple:

 void setup() {
  // put your setup code here, to run once:
  //pinMode(10, OUTPUT); 
  //pinMode(8, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(5, OUTPUT); 
  pinMode(6, OUTPUT); 
  pinMode(10, OUTPUT); 
  pinMode(11, OUTPUT); 


  //digitalWrite(8,HIGH);
  //digitalWrite(10,HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
  digitalWrite(10, HIGH);
  digitalWrite(11, HIGH);

}

void loop() {
  // put your main code here, to run repeatedly:

}

For the schematics

The toplevel view; For now ignore the leds and the clocks. Not connected in the current version Schematic Led driver

The board you can find below. The board

\$\endgroup\$
  • \$\begingroup\$ what are those output pins connected to? GPIO pins can only supply a limited amount of current \$\endgroup\$ – ratchet freak May 11 '18 at 9:17
  • \$\begingroup\$ With 0.12 V on a pin it very likely shorted to ground. Measure the resistance when there is no power. (Or the whole CPU has no power....) \$\endgroup\$ – Oldfart May 11 '18 at 9:22
  • \$\begingroup\$ I uploaded the schematics and board files now. Hopefully there is something obvious going on. @Oldfart since, I am somewhat noob to this, where should I probe? \$\endgroup\$ – Kenneth Østby May 11 '18 at 12:16
0
\$\begingroup\$

I notice that you do not have any decoupling capacitors anywhere. Not around your regulators, not around your CPU.

Also you do not have a reset circuit. You need one!

Fix those first before doing anything else.

\$\endgroup\$
  • \$\begingroup\$ Ah, thanks! I will try those ones out, and see if it helps. I'm still a bit confused on why it works on the breadboard, but not on the PCB. Might be that the life on the PCB is a bit more hostile though. \$\endgroup\$ – Kenneth Østby May 11 '18 at 13:24
  • \$\begingroup\$ The decoupling caps. did the trick it seems. The reset circuit was not strictly needed, but could be useful. Thanks! \$\endgroup\$ – Kenneth Østby May 21 '18 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.