I am attempting to program an ATtiny13a micro with avr-gcc and on Mac OS 10.6. I chose this as my first micro project after reading a "beginning AVR programming" article on MIT's High-Low tech website. It seemed simple enough, and cheap enough to try.
The sample code compiles no problem. I have changed the -mmcu flag to "attiny13a", otherwise I have made no changes to the "blink light" sample code. However, I have not been able to download the hex file onto the micro using avrdude.
Is this even possible? By possible I mean possible to do on a mac? There are tutorials that indicate that this is doable, but they always seem to be 2 or 3 years old. Perhaps there are incompatibilities with my hardware. Is anyone developing using a Mac, the AVRISP mkii, and ATtiny13a, or something similar?
The vast majority of the times I've seen a device signature listed as 000000, FFFFFF, or some combination thereof, it has been a bad connection in the ISP lines and/or I had them plugged in the wrong place, and/or the target chip didn't actually have power.
Essentially, if it doesn't cough up a valid valid looking signature, there is no communication at all.
As I can tell your command is a bit wrong: avrdude -b 1 -p t13 -c avrisp2 -P usb -e -U flash:w:blink.hex -v -v -F
But your almost there
Try something like this instead:
avrdude -p t13 -c avrisp2 -P usb -U flash:w:blink.hex
I do not recommend using the -F and -e commands, see the two links above for information.
The -v -v command is up to you.
Alternative, just try the following command, to see if you got connection:
avrdude -p t13 -P usb -c avrisp2
If that does not work, try changing usb to the serial port. Try typing "ls -l /dev/cu.*" in the terminal, and you will see all your ports, it will look something like this: /dev/cu.usbserial-A700dX8R
Also make sure that you are in the same directory, as the blink.hex file, using the cd command. Alternative just move the file to "Macintosh HD", then you do not have to worry about that
Looking through the forums here and at avrfreaks, I've seen libusb mentioned as something that needs to be compiled into avrdude.Is it a safe assumption that I do not need to recompile avrdude from crosspack? Also, Do I need to install a driver for the USB chip on the AVRISP mkii programmer?
When I plug in the AVRISPmkii, no new devices appear in /dev/cu.* The ones listed seem to be associated with bluetooth.
eraticus$ ls /dev/cu.*
/dev/cu.Bluetooth-Modem /dev/cu.RN42-0847-SPP
/dev/cu.Bluetooth-PDA-Sync
When I run the command listed above, I get this result:
MacBook-Air:code eraticus$ avrdude -p t13 -P usb -c avrisp2
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Also, there is a green led which flickers within the the AVRISPmkii case, and the external LED turns green after running.
Yes, the AVRISP mkii manual on page 26 shows the labels for the board pins, not the female cable! When I reversed the cables left over right, I got success. Thank you for your help!!!
Just in case anyone else wants to do this, here is a picture of the working programming circuit: