This page attempts to describe a procedure for installing a complete GCC-based toolchain on a modern Windows system. I've developed these instructions on my Windows 10 machine, but they should work for versions of Windows as far back as Windows 7. On older versions, you might want to use WinAVR. WinAVR used to be the preferred way to get this toolchain set up on Windows, even to the point of being semi-official, but has not been maintained in years. The installer reportedly wreaks havoc on newer Windows versions, but it likely works great on XP.
We're going to use the bash shell installed by Git as our starting point. It's easy to install, and if you're using Git on Windows, you might have it already. Click the Start menu and search for "Git Bash". If it comes up, you have it already. If not, download and install Git for Windows. The defaults for all of the choices in the installer will work for our purposes.
Download the Atmel AVR Toolchain for Windows from Atmel's site and run the installer. When asked where to extract the files, click the "..." button and navigate to C:\Program Files, then click Extract.
Download Gnu Make and launch the installer. Accept the default location for the installation. You can choose whether or not you want an icon in your start menu.
Download avrdude. Unzip the archive, and copy the archive inside to C:\Program Files.
Now we need to tell Windows where to locate all of the tools you've just installed when you type their names on the command line. Go to the Start menu and open the Control Panel, then go to System. From the left pane, choose "Advanced System Settings". Under the Advanced tab, click the "Environment Variables" button.
Under User variables, select "Path" and click the Edit button. If you don't already have a variable called "Path", click the New button to create it, enter "Path" without the name, and fill out the value as described below.
The Edit window that pops up is unfortunately different depending on whether you are creating a new variable or only have one item in your path, or if you have multiple items in your path already. In the first two cases, you just get a textbox for a value. In the third case, you get a list of values. Either way, you want to add the following three values. If you get the list, add them as separate items (see screenshot below). If you get the textbox, enter them separated by semicolons. Make sure that they are entered exactly or Windows won't be able to find the programs.
The three values to add are:
Click OK on all of the windows you've opened.
This tutorial assumes you are going to use a FabISP, FabTinyStarISP, or other USBtiny-based programmer. If you are using one of the official Atmel programmers instead, the easiest way to get the drivers is to install Atmel Studio.
The USBtiny programmers use a generic libusb driver, but Windows 10's driver signing policy makes the installation more complicated. Fortunately, there's a tool that helps with this. Download Zadig and launch it. Plug in your programmer, and select the "USBtinySPI" device in the list. (If it doesn't show up, go to the Options menu and click "List All Devices". The driver you want to install (to the right of the green arrow) is either libusb-win32 or libusb0. Click the "Install Driver" button. You should only have to do this once.
Everything is now installed. Let's check that it all works.
Go to the start menu and search for "Git Bash" and start it. When you see instructions telling you to open your terminal in other tutorials, this is the terminal window you should use.
Check to make sure that the commands we installed work okay:
Type make -v and press enter. You should see:
GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc.
... and so on.
If you get a "command not found" error instead, re-check your installation of make and your path variable setting for typos.
Type avr-gcc --version and press enter. You should see:
avr-gcc.exe (AVR_8_bit_GNU_Toolchain_3.5.4_1709) 4.9.2
... and so on.
If you get a "command not found" error instead, re-check your installation of the Atmel toolchain and your path variable setting for typos.
Connect your programmer to a USB port and type: avrdude -c usbtiny -p t45 and press enter. You should see:
avrdude.exe: initialization failed, rc=-1 ...
This means that avrdude successfully found your programmer, but failed to talk to a target board (expected because we don't have anything conencted to the programmer right now.)
If instead you see:
avrdude.exe: Error: Could not find USBtiny device (0x1781/0xc9f)
check your USB driver installation (the Zadig steps).
If you get a "command not found" error, check your installation of avrdude and your path variable.
You should be ready to go!
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.