This tutorial will only cover Windows XP users and not Windows Vista users nor Mac nor Linux users. Windows Vista users have reported problems with the AVR MKII, so if you have Vista you have two options : Install XP or Download and Install a Free Virtual Machine that runs Windows XP. This tutorial also assumes that you have AVRstudio installed - http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 .
The first step to programming with your AVR microcontroller is to connect your AVR programming connector to the AVR microcontroller . Connect MOSI of the connector to MOSI of the microcontroller, MISO to MISO, VCC to VCC , etc.
Many microcontroller boards already have ISP programming sockets so you can just plug in the ISP connector into that. My Axon and Roboduino already have ISP programming sockets built in.
Once you have your programmer, plug the programmer into your computer's USB Port.
A few seconds after you plug it in you should see a windows pop up which asks if you want to locate
drivers automatically. Choose to install software automatically and wait a few minutes until it installs.
Now that your drivers are installed just open up your AVRstudio project. Press build to Build your current project.
Turn on your microcontroller board, the light inside the AVR programmer should turn green. Then click the Programmer Button in the toolbar -
A window should pop up. Select AVR MKII Programmer and select USB.
Click "Connect" and now another window should pop up.
Now verify that the device selected is indeed your device. Click the "Settings" button right above ISP Frequency, and set your ISP frequency to 125 kHz.
Now select the Program tab and verify that the file in the Input Hex File textbox is indeed your hex file that was generated from your code.
Press the Program button directly underneath the Input Hex File .Your microcontroller should program now.
Now if this is your first time programming with your AVR MKII programmer , chances are that its not working properly.
Servos Jittering While Programming: This happens sometimes because the programmer applies some power to pins while its programming. Don't worry about it.
Read Signature Check - this makes sure that ISP frequency is correct and wiring is correct
Flashing Orange Light - Bad circuit
Red Light - No power, bad circuit
Green Light - Good voltage, but possible to not program b/c of ISP frequency
Use a multimeter to verify connections
Check to see if you plugged in the connector correctly, the arrow symbol on the connector designates where pin 1 is.
Common Problems and Solutions
Wrong ISP Frequency : This is probably the most common issue. When you bring up the little programming dialog box, go to the Board tab and set the frequency to 125.0kHz. See it if works now . It should be set to less than 1/4 of the Microcontroller's frequency , but I've found that around 1/8 of the microcontroller's frequency works best. One symptom of bad frequency is Success for Programming but Failure by Verification.
Bad Wiring - Double check and triple check, use a multimeter to check
Mixed up MISO-MOSI : For some reason the AVR people decided to use the acronyms MOSI and MISO, and they look almost exactly the same. Make sure you didn't mix up MOSI and MISO in your circuit.
Make sure proper voltage and powered up when programming - Should be getting around 5V from a regulator, in truth even up to 6V will work fine but not recommended
Selected the Wrong Programmer - In the Connection dialog make sure you picked AVR MKII and NOT AVR ISP Programmer.