Now that have installed the necessary software, you are now ready to learn about the required hardware to program these microcontrollers.
If you open up AVRDUDESS you can click the top left drop down menu and see all of the supported programmer types.
This list is generally one that has been added to over time.
Meaning, you don't need 99.99% of this list.
If you have an Arduino and plan on programming it with the Arduino software, which works with C, you will be using the USB connector that came with it.
Programmers come in all shapes and sizes.
Their job is to pass on the Hex file, the 1's and 0's to the AVR chip.
We need this middle man to provide power to the chip, VCC and GND, establish the correct timing, SCK, and set up the Master Out Slave In, MOSI, and Master In Slave Out, MISO, connections.
So, the chip will be powered, speak with the computer through an agreed upon frequency and exhchange information fairly.
We also need it to pull the RESET pin low (ground it) on the AVR.
This signals to the AVR chip to enter into programmable mode.
Most programmers feature 6 pins that either come with an attachable ribbon cable for simplicity or 10 pins which just have more GND pins and maybe an extra unused pin. There are also adapters that convert 10 pin connectors into 6 pin connectors by bridging all the GND pins.
I recommend the 6 pin type.
Why waste time fumbling with a 10 pin version?
If you end up getting a 10 pin version, there are cheap 10 pin to 6 pin adapters like you see on the right here.
I do not recommend most off brand/ebay/Amazon usb programmers like this Chinese USBasp clone because 9 times out of 10 you will need to download something like Zadig in order to flash the programmer with another downloaded firmware file just to make the thing work correctly.
I've done it with 2 USPasps which are known to have issues.
The best usb programmers that I recommend because they are QUALITY, CHEAP, and EASY to use are found on the Sparkfun and Adafruit sites.
Get one that is already assembled. I prefer the Sparkfun USBtiny Pocket AVR Programmer.
It works flawlessly and comes in handy when you are powering your projects on the breadboard or even testing components.
It also is protected from your accidental short circuiting, etc.
This one is also stated as working well with the 328p chips, so you can be sure it will work, unless you bought fake/damaged/bricked/crystal oscillator connected chips.
It is sexy red and has saved my sanity.
I HIGHLY recommend it.
These are very well made, up to date, easy to update the firmware which is found right on their site and tutorials for any problems as well as customer support.
I cannot stress this enough. Trust me from experience.
Nothing is more frustrating than spending money on a usb programmer that you can't seem to get working.
All the while your C program and breadboard sit by themselves.
Don't waste time just to save a few dollars. C'mon!
How to hook up the programmer connector to the AVR 328P chip
Here is the layout of the 6 pin ISP connector like the one used on the USBtiny Pocket Programmer I recommend.
The colored diagram and the head here are in the exact same position.
Remember, we are looking directly at the holes here. Don't get confused.
Use the tab sticking out on the side as reference.
Now let's look at the 328P pinout once more.
Notice the little circular indent at the top of the chip?
Make sure your's is facing the same way.
Do you see where each connection will go?
One more thing for good practice is to put a small capacitor across the VCC and GND pins like you see here.
This helps to prevent brownouts and make sure there is a constant voltage supply to the chip.
Even tapping the wires could cause a stutter.
I have connected the same color wires as in the diagram above to help you see where each wire goes but remember justice is color blind and will let you know if you mixed up the wires (which you will do, it's ok).
You can also connect an LED, with a resistor of course, to see if power is being supplied correctly to the AVR.
You could also experiment with putting LEDs on the data lines, etc to illustrate the communication that goes on between the usb programmer and the AVR chip!
Remember to hook up the negative side of the LEDs to GND.
Again, if you are using the Arduino with the usb connector you have much less to worry about but miss out on vital understanding and hands on experience with the incredible programming process that takes place.
Refer to the Arduino pinout on your own.
From here on out, we are going barebones.
You are free to carefully pop out the AVR chip on your Arduino board.
That's right, just slide a small screwdriver along the bottom and lift it up.
Get my favorite books on programming AVR chips I use.
Equip yourself with the most dependable, no hassle, quality usb programmer I use daily.
I started with something very similar.
That wasn't so bad right?
You should practice making these connections on the breadboard a few times.
It will also help to print out the pinout diagrams for reference. I usually taped them to the wall.
In a few lessons, you will be learning how to flash the code to the chip while it is all hooked up like this.
If you encounter problems flashing your programs soon triple check your wiring.
Pull it all out and try again.
I can't tell you how many times I THOUGHT I had it right when I swapped 2 wires for some reason.
It happens all the time, even to experienced professionals.
Sometimes there could be a faulty wire or you just need to relocate the chip on the breadboard to somewhere else.
Remember, this is magic. It's not for the lighthearted.
Which is why your power levels are about to EXPLODE beyond 9000!
See you in the next lesson!