0
\$\begingroup\$

For one of my project, I need an atmega2560. So I made a PCB with the atmega2560 and ISP headers. But I can't communicate with the atmega2560 There is also an external 16000Mhz oscillator.

Here is what I checked :

  • No short circuit
  • MOSI, MISO, SCK and RESET all have continuity from the header to the pins
  • The programmer used is an arduino Uno with the ISP Programmer sketch on it. (This arduino has been tested and is able to program another arduino uno via ISP)

Here is how everything is wired on the PCB. It's very minimalist : atmega2560, oscillator and two 22pf capacitors

What am I missing ?

I just have one VCC pin of the atmega2560 connected to VCC. Same for ground. Is this okay, or every VCC pin and every GND should be connected ?

Thank you in advance!

\$\endgroup\$
3
  • 3
    \$\begingroup\$ Do you really have a 16GHz oscillator or is that a typo? Also, you should connect every Vcc and ground, and use decoupling caps too. \$\endgroup\$ Commented May 4, 2016 at 19:09
  • 2
    \$\begingroup\$ You should definitely connect all VCC and GND pins, also place a 100nF decoupling capacitor between VCC and GND at every VCC pin. The capacitor should be as close to the IC as possible. \$\endgroup\$ Commented May 4, 2016 at 20:13
  • \$\begingroup\$ Ooops.... of course 16Mhz and not 16000Mhz. Okay, next design I do, I'll connect every VCC and GND. But for now, can it still work with only one VCC pin and one GND pin ? \$\endgroup\$
    – tuxben
    Commented May 4, 2016 at 20:33

1 Answer 1

3
\$\begingroup\$

can it still work with only one VCC pin and one GND pin

No. The MCU will not work correctly like that. I have seen various different incorrect behaviours when this design mistake has been made, so I am not surprised that you are having problems. :-(

As other experienced members have already kindly explained, you also need decoupling capacitors close to the MCU (see below). The oscillator and its capacitors need to be close to the MCU too.

Atmel Application Note: AVR042: AVR Hardware Design Considerations (522kB PDF) is full of advice, shows you all the Vcc and Gnd connections being used, decoupling capacitors, discusses PCB layout and oscillator placement etc. I recommend that you follow its suggestions.


Edit: Here is a related question being asked about using all of the Vcc (Vdd) and Gnd (Vss) pins on PIC MCUs - the answers apply here too, for the same reasons given:

If a PIC MCU provides multiple Vdd/Vss should you provide power to them all?


Edit: Adding update to summarise some comments on this answer, for future reference: AVcc must also be connected, even if the ADC is unused. The AVR datasheets specify how closely the AVcc voltage must be to the Vcc voltage, and an unconnected AVcc violates that requirement.

For example, the ATmega2560 datasheet specifies that AVcc must be between Vcc-0.3V to Vcc+0.3V. So if AVcc = 0V (unconnected), that exceeds that +/-0.3V difference from any operational Vcc voltage.

\$\endgroup\$
9
  • \$\begingroup\$ thank you for your very detailed answer @SamGibson ! For my future design, I will follow this rule! thank you! Plus the fact that not all VCC, and not all GND are connected, the only VCC and GND connected are not even on the same side. As I have already done my PCB and that I need it to work for in a few day, do you think that if I bring VCC to the same side, I might have a chance for it to work? \$\endgroup\$
    – tuxben
    Commented May 4, 2016 at 23:16
  • \$\begingroup\$ @arckin : "For my future design, I will follow this rule" - Note that the document I linked contains several rules. :-) "do you think that if I bring VCC to the same side, I might have a chance for it to work?" - Sorry, I don't understand. Please add a clear PCB diagram (or photo of an empty PCB) to your original question using the "edit" link, showing all of the MCU pins. Then readers might understand your additional question. And remember that any answer would be a guess. Also a partial workaround might succeed in allowing your MCU to be programmed - but it might not run reliably. :-( \$\endgroup\$
    – SamGibson
    Commented May 4, 2016 at 23:32
  • \$\begingroup\$ Yes, I will read all the rules of the document you gave me! Again, thank you for this precious information! Sorry, my question wasn't clear. Here is a pinout of the atmega2560 : here Only the pin 80(VCC) and 32(GND) are connected. Do you think it might work if I hardwire pin 31 to the VCC rail? "Also a partial workaround might succeed in allowing your MCU to be programmed - but it might not run reliably" - Yes, I'm aware of that :( \$\endgroup\$
    – tuxben
    Commented May 4, 2016 at 23:46
  • 1
    \$\begingroup\$ @arckin : "Do you think it might work if I hardwire pin 31 to the VCC rail?" - It might work, but personally I doubt it (at least, not work reliably). That still leaves several pins unconnected. As a start, I would add SMD decoupling caps physically between each pair of Vcc + Gnd pins (including AVcc and its adjacent Gnd), then use minimal lengths of wirewrap wire across the top of the MCU to link all the Vcc and AVcc pins (same with the Gnd pins). The capacitors give a larger physical "target" to solder, than the bare MCU pins - but the choices depend on PCB layout and other factors. \$\endgroup\$
    – SamGibson
    Commented May 5, 2016 at 0:01
  • 1
    \$\begingroup\$ true, I haven't mentioned the AVCC, but it is actually connected to VCC. Thank you! \$\endgroup\$
    – tuxben
    Commented May 5, 2016 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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