I'm pretty new to mcu programming so I'm looking for a little help. I just got an ATTiny104 Xplained Nano and I'm trying to do a simple blink program just to make sure that I have my toolchain setup correctly. I am using a Mac so I can'y just download Atmel Studio so I'm doing it all with avr-gcc. With the help of this forum I finally got it compiling by adding the atpack files to the avr-gcc folder but now I'm trying to flash it to the device with avrdude. I found a post (again on here) about updating the avrdude.conf file to add the attiny102/104 so I added that but I can't get it to communicate with the built in programmer. My first attempt was:
$avrdude -c usbasp -p attiny104 -u -U flash:w:main.hex
But that says:
avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
So I thought that maybe it didn't have the right programmer configuration so I got the vid, pid, vendor and product and added a new entry to the avrdude.conf file that looks like this:
programmer id = "xplained"; desc = "Xplained, http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=ATTINY104-XNANO"; type = "usbasp"; connection_type = usb; usbvid = 0x03EB; # ATMEL usbpid = 0x2145; # Xplained built in programmer usbvendor = "ATMEL"; usbproduct = "mEDBG CMSIS-DAP"; ;
Then I try again with this command:
$avrdude -c xplained -p attiny104 -u -U flash:w:main.hex
and it seems to find the device but it can't communicate with it resulting in this error:
avrdude: error: usbasp_transmit: Broken pipe avrdude: error: usbasp_transmit: Broken pipe avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: error: usbasp_transmit: Broken pipe avrdude: error: usbasp_transmit: Broken pipe avrdude: error: program enable: target doesn't answer. 0 avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check. avrdude: error: usbasp_transmit: Broken pipe
I've done more searching and the only thing I could find for this that looked remotely helpful was a post about setting up this board for use with the Arduino IDE but that involved using Atmel Studio to flash a new bootloader, which I can't do.
Am I on the right track? Has anyone gotten this working on a Mac? What am I missing?