This week, the assignment was to read a microcontroller data sheet, and program our boards from a couple weeks ago to do something with as many different programming languages and environments as possible. I used 64-bit Windows 7 and tried 3 different approaches – Atmel Studio, Arduino + WinAVR. Ultimately, WinAVR and Arduino were the ones I could get working.
1. Plug in your FabISP
2. Control Panel > Devices and Printers - right click on the FabISP icon and select properties
3. Download and install these drivers.
4. In your FabISP properties, there should be an option to specify a filepath for a driver. Select the folder that contains the drivers you downloaded in step 3 as the filepath.
5. Install the drivers - now you should be able to communicate w/ your board through arduino, atmel, winavr, etc. Without the drivers, you can't specify a serial port in arduino to load the bootloader, etc.
The fab academy at AS220 also offers a great tutorial on how to do so here.
avrdude: usbdev_open(): did not find any USB device "usb"
avrdude -p t44 -P usb -c avrisp2 -U lfuse:w:0x5E:m
avrdude: usbdev_open(): did not find any USB device "usb"
make: *** [program-avrisp2-fuses] Error 1
avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x5E:m
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
make: *** [program-usbtiny-fuses] Error 1
Zach@VHS1 ~
$ cd /cygdrive/e
Zach@VHS1 /cygdrive/e
$ make
avr-objcopy -O ihex blink.out blink.c.hex;\
avr-size --mcu=attiny44 --format=avr blink.out
AVR Memory Usage
----------------
Device: attiny44
Program: 104 bytes (2.5% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
Zach@VHS1 /cygdrive/e
$ make program-usbtiny-fuses
avr-objcopy -O ihex blink.out blink.c.hex;\
avr-size --mcu=attiny44 --format=avr blink.out
AVR Memory Usage
----------------
Device: attiny44
Program: 104 bytes (2.5% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x5E:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9207
avrdude: reading input file "0x5E"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0x5E:
avrdude: load data lfuse data from input file 0x5E:
avrdude: input file 0x5E contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude done. Thank you.
Zach@VHS1 /cygdrive/e
$ make program-usbtiny
avr-objcopy -O ihex blink.out blink.c.hex;\
avr-size --mcu=attiny44 --format=avr blink.out
AVR Memory Usage
----------------
Device: attiny44
Program: 104 bytes (2.5% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
avrdude -p t44 -P usb -c usbtiny -U flash:w:blink.c.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9207
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "blink.c.hex"
avrdude: input file blink.c.hex auto detected as Intel Hex
avrdude: writing flash (104 bytes):
Writing | ################################################## | 100% 0.13s
avrdude: 104 bytes of flash written
avrdude: verifying flash memory against blink.c.hex:
avrdude: load data flash data from input file blink.c.hex:
avrdude: input file blink.c.hex auto detected as Intel Hex
avrdude: input file blink.c.hex contains 104 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.09s
avrdude: verifying ...
avrdude: 104 bytes of flash verified
avrdude done. Thank you.