Part of programming stand-alone ATmega chips is setting the fuse bytes, these are special settings that can be used to change how the ATmega chips operate.
Some of the things you can do by changing the value of the fuses include;
- select different clock sources and change how fast the chip runs,
- set the minimum voltage required before the chip works.
- set whether or not a boot loader is used,
- set how much memory is allocated to the boot loader,
- disable reset.
- disable serial programming
- stop eeprom data being erased when uploading a new sketch.
There are many articles online but I could not find a single source that brought all the information together and fully explain what the fuses actually do.
It is important to remember that some of the fuse bits can be used to lock certain aspects of the chip and can potentially brick it (make it unusable). However, with a bit of care it is fairly straight forward to understand and use the fuse settings.
Disclaimer, I am relatively new to programming fuses and these are notes I wrote to help me remember things. The information is based on the data sheet for the ATmega chip, internet searches, and questions I asked on forums (especially the Arduino forum).
05.12.2015 Updated the photos.
In a previous post I showed how to make your own Arduino on a breadboard. The next step is programming it.
Using an Arduino Nano to program a ATmega328P chip
There are many guides online on how to use an Arduino to program a ATmega chip, two goods ones are:
Using an Arduino as an AVR ISP (In-System Programmer)
Nick Gammon’s guide
If you google “using Arduino as a programmer” you will find most of the results are for using an UNO, very few are for the Nano. One Nano guide I did find is at Lets Make Robots This explains how to set up the Nano but it does not clearly show how to program a stand alone Atmega chip.
Breadboard Arduino / Stand Alone ATmega328P
Here is my Arduino on a breadboard. There are many online guides for creating a breadboard Arduino. All are basically the same and follow the same connections. Some use pre-programmed chips, others use blank chips. My intention was to use a new blank ATmega chip (no boot loader) and use an Arduino Nano as an ISP programmer.
When building prototypes on breadboards I find it useful to have small pre-made components such as 3.5 stereo jack sockets configured to fit breadboards
The 3.5 stereo socket is attached to a small piece of board and the connectors from the socket attached to pins that fit in to a breadboard.
Red is VCC, black is ground, and white is the centre channel or data
I also create mini boards that have more than one component
These have female or male headers and can be connected using standard breadboard wires