Fork me on GitHub

Project Notes

#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

About LEAP#68 ArduinoATmelICSP
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.