Electrical – programming atmega2560 by ISP on self-made PCB

atmegaisppcb

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!

Best Answer

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.