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

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

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - 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.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader