Skip to content

Files

Latest commit

146f34b · Jan 26, 2025

History

History

ATmegaViaArduinoISP

#068 ATmegaViaArduinoISP

Programming an ATMEGA328P-PU on a breadboard with Arduino ISP

The Build

Notes

The objective here is to setup an ATMEGA328P-PU chip on a breadboard, and program it via an Arduino operating as an in-system programmer. I subsequently built a DIY shield version of this project in LEAP#099 ATmegaISPShield.

See more links and references at the end, but these videos cover at all very well:

Arduino as ISP

clip

Arduino on a Breadboard

clip

Julian's Ardutorials: Arduino as an ISP

clip

Programming Procedure

Wire up according the schematics attached. The ATmega168/328-Arduino Pin Mapping page is a good reference for understanding how the chip pins relate to familiar Arduino functions.

Setup the Arduino ISP. In this case I'm using an Arduino Uno as the programmer:

  • Select Tools > Board > Arduino Uno
  • Select Tools > Port > (correct port for Arduino Uno)
  • Upload Examples/ArduinoISP sketch to Arduino Uno
  • Select Programmer > Arduino as ISP

Next burning the bootloader. A bootloader may already be present on the chip in which case this may not be necessary. But if in doubt, burn it again:

  • Select Tools > Burn Bootloader

Now the system is ready for uploading a sketch.

  • Open desired sketch
  • Select File > Upload Using Programmer (or shift-click the normal upload icon)

Crickey, it works.

Construction

The Breadboard

The Schematic

The Build

NB: in the picture, digital pin 9 (chip pin 15) is wired to a LED for a test scketch

Programming in-circuit via ICSP header

This approach can also be used to program chips on a board with an ICSP header.

The conventional arrangement of the ICSP pins is as follows. Although the pin numbering approach may vary, the functions should be in these positions:

icsp_header

The 5V power pin should only be connected if one wants to power the target board via the header. If the board is already powered, it should not be connected.

Whether the target host can or should be powered via the header depends largely on the design of target circuit.

Here's a circuit (actually LEAP#368 GranularSynth) being programmed via an ICSP header:

programming_via_icsp

Credits and References