Setting up Atmel programing for Windows This document describes setting up the compiling and programming environment for Atmel microcontrollers under Windows, using the Tuxgraphics programmer. Install WinAVR: web page: http://winavr.sourceforge.net/ Help page: http://winavr.sourceforge.net/install_config_WinAVR.pdf To use the tuxgraphics avrusb500v2 programmer (http://shop.tuxgraphics.org/electronic/detail_avrusb500smd2.html) it is necessary to edit C:\WinAVR\bin\avrdude.conf by adding the following lines to the section headed # PROGRAMMER DEFINITIONS programmer id = "avrusb500"; desc = "Atmel AVR ISP V2"; type = stk500v2; ; Plug in the programmer, and see where it turns up, mine was COM4, found by looking in Device Manager, Ports (COM & LPT) under USB Serial Port (COM4). Then create a Makefile, or edit an existing one. The relevant lines are the ones starting avrdude Here is an example for a project called widget which uses a set of library functions from the file usart.c in the lib subdirectory: CPPFLAGS=-I. -I../lib MCU=atmega644p VPATH=../lib all: widget.hex widget.elf: widget.o usart.o %.o: %.c avr-gcc ${CPPFLAGS} -Os -mmcu=${MCU} -o $@ -c $^ %.elf: %.o avr-gcc -Os -mmcu=${MCU} -o $@ $^ %.hex: %.elf avr-objcopy -j .text -j .data -O ihex $^ $@ %.lst: %.elf avr-objdump -h -S $^ > $@ clean: rm -f *.o *.elf *.hex *.lst program: widget.hex avrdude -p m644p -P COM4 -c avrusb500 -e -U flash:w:$^ fuses: avrdude -p m644p -P COM4 -c avrusb500 -e -U hfuse:w:0xD9:m avrdude -p m644p -P COM4 -c avrusb500 -e -U lfuse:w:0xC7:m Key parts are the definition of the microcontroller: MCU=atmega644p the path to the library: CPPFLAGS=-I. -I../lib VPATH=../lib the microcontroller definition for avrdude avrdude -p m644p the location of the USB port the programmer is attached to: -P COM4 the type of programmer: -c avrusb500 Then to program, cd to the source directory make, make clean, make program seem to work as expected