This project will consist of setting up at Atmega 328 microprocessor on a breadboard. This will be mostly compatible with the Arduino Uno. This project is for those who are minimalists, or those who want to learn more about how the external circuitry works on a microprocessor. I created the image below with Fritzing, and we will be using this as an example:
Disclaimer: Although I believe this information to be accurate, the information is provided “as-is”. You are responsible for ensuring the accuracy, safety issues, etc. If you find corrections that need to be made, please let me know.
1 Breadboard and assortment breadboard jumpers
1 Power Supply (recommended 7 to 12 VDC) 500ma should be more than sufficient.
1 Atmega328-PU processor
1 FTDI Basic programmer (Optional but handy)
2 capacitors (10 microfarad)
2 capacitors (22 picofarad)
1 resonator (16MHz)
1 resistor (10K ohm)
1 resistor (1K ohm)
1 LED indicator
1 7805 Voltage regulator (5v)
1 Pushbutton (for reset circuit)
Step 1 — Power your Breadboard
There are many ways to power up your breadboard. Breadboard power supplys can be purchased that are already regulated and filtered. Another option is to power the breadboard with the VCC pin of the FTDI programmer if enough current is available. In this example, we will be bringing in a 7 to 12 VDC supply that we can purchase at most any thrift store for under $1. We won’t need a lot of current for this simple circuit, so 500ma should be more than sufficient.
In the circuit below, we will bring in power from this supply on the left. Add a 10 microfarad capacitor across the + and -, but be careful when using electrolytic capacitors because polarity is important. The long lead is usually the +, and the short lead is -. This should be marked on the capacitor as well. After the capacitor, the + will go to the left pin of the 7805 voltage regulator, and – to the center pin. This center pin will also go to the – of our breadboard power rail, and the right pin will go to + on the brreadboard power rail. Add another 10 microfarad capacitor across the breadboard power rails after the regulator for further filtering. We will also jumper the power rails together as shown on the breadboard.
Step 2 — Power the Atmega 328 Microprocessor
Please take a look at the pinout of the atmega328 microprocessor. You can search google for a pinout diagram, but at the time of this writing, a good diagram is shown at this link. http://www.hobbytronics.co.uk/image/data/tutorial/arduino-hardcore/atmega328-arduino-pinout.jpg You may want to print the pinout image for future reference. We need to connect our + rail to pins 7 and 20 on the chip as shown. The – on our power rail will connect to pins 8 and 22.
For now, we’ll just connect the red and the green lines that are shown. The blue lines will be connected later.
Step 3 — The resonator circuit
Some of the processors have an 8 MHz resonator built in that can be used on the Atmega328. I’ve found this to be somewhat unstable though, and changes must be made to the chip to enable the internal resonator. In this circuit, we will use an external 16 MHz oscillator. This will be our “clock” that will control the speed at which the chip will process information. The resonator will be placed across pins 9 and 10, then each leg of the resonator will go through a 22 picofarad capacitor, which is then connected to ground (-).
Step 4 — The reset circuit
Pin 1 (just to the left of the notch of the chip) is our reset pin. We need to hold this pin in a high state with a 10k resistor. When a pushbutton is pressed, pin 1 will be placed at ground potential, and the processor will reset. When we press the button, some current will flow through the resistor, but with a 10K resistor, this is only 5 microamps. When we release the pushbutton, pin 1 has a very high input impedance, so pin 1 will be placed at the 5v level by the 10K resistor. For now, we will just connect the resistor, pushbutton, green, and blue wire as shown.
Step 5 — The LED circuit
To test our circuit later on with the blink example, we will want to connect an LED indicator. Pin 19 of the chip (Digital pin 13 in software) will go through a 1K resistor. This 1K resistor will the be connected to the + side of the LED. The + side of the LED usually has the longest lead. The – side of the LED (short lead) will then be connected to ground.
Step 6 — Connect the FTDI programmer
The FTDI programmer is optional, but it does make this circuit easier to program. Otherwise, we would have to remove the Atmega 328 to place it on an Arduino Uno board for programming, then move the chip back onto our breadboard. The FTDI programmer will allow us to program the chip while it is in place as long as the chip has a bootloader on it. If you removed this module from an Arduino for this experiment, then chances are that it does have the bootloader set up. Connect the Receive pin (chip’s pin #2) to transmit of the FTDI Programmer. Connect the transmit pin of the Atmega 328 (chip’s pin #3) to the receive pin of the FTDI programmer. Then connect ground of the FTDI programmer to ground (-) on the breadboard.
Step 7 — Upload the Blink example
In your Arduino IDE open the Blink example. When you are ready to upload, press the upload button in the IDE, and quickly press the reset button simultaneously. This might take a few tries to get used to, but your LED should now be blinking.
— Ricky Bryce