To enhance my learning and allow easy fiddling around on a breadboard, I bought the 10 dip package chips also. These are almost certainly counterfeit, but for what I want to do I don't care whether they are or not.
The 6 pin header shown on the right above is the "ISP" (in system programming) header that is found on many AVR products, including the Adafruit Atmega32u4 breakout I am going to use for initial testing.
The challenge now is to connect this to the Adafruit breakout. This is complicated by the fact that Adafruit did not feel compelled to mark pin 1, but by locating ground and Vcc we can sort this out. I tried them out by connecting them to an Adafruit Atmega32u4 Breakout Board that I had laying around. This board has a 6 pin ISP header that I connect to as follows:
ASP pin 1 to ISP pin 4 -- MOSI ASP pin 2 to ISP pin 2 -- Vcc ASP pin 5 to ISP pin 5 -- Reset ASP pin 7 to ISP pin 3 -- Sclk ASP pin 9 to ISP pin 1 -- MISO ASP pin 10 to ISP pin 6 -- GndThis dongle has a jumper that selects 3.3 or 5 volts (silk screen on the bottom guides you). I set this to provide 3.3 volts. When I plug the dongle into my linux machine (with the breakout dangling on the cable) red LED's on the dongle and the breakout light up and I see the following messages:
Oct 16 12:31:34 trona kernel: usb 2-1.7: new low-speed USB device number 8 using ehci-pci Oct 16 12:31:34 trona kernel: usb 2-1.7: New USB device found, idVendor=16c0, idProduct=05dc, bcdDevice= 1.02 Oct 16 12:31:34 trona kernel: usb 2-1.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Oct 16 12:31:34 trona kernel: usb 2-1.7: Product: USBasp Oct 16 12:31:34 trona kernel: usb 2-1.7: Manufacturer: www.fischl.deSo, no attempt to connect a driver or act like this is a tty device. Now the thing to do is see if AVRdude will play nicely with it.
avrdude -p m32u4 -c usbasp avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e9587 (probably m32u4) avrdude: safemode: Fuses OK (E:C3, H:D0, L:FC) avrdude done. Thank you.So, it does see a 32u4 chip. I am not sure how crucial the warning about setting sck and updating my usbasp firmware is. I get a little braver and try reading out the flash (in the 32u4):
avrdude -p m32u4 -c usbasp -U flash:r:flash.bin:r avrdude: warning: cannot set sck period. please check for usbasp firmware update. avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e9587 (probably m32u4) avrdude: reading flash memory: Reading | ################################################## | 100% 20.10s avrdude: writing output file "flash.bin" avrdude: safemode: Fuses OK (E:C3, H:D0, L:FC) avrdude done. Thank you.I am not sure why avrdude thanks me, but I appreciate polite firmware. This yields a 32448 byte file. This all seems to be working.
My second Ebay dongle is easy to test, I just transfer the cable, plug it in, and repeat the avrdude commands. It yields a binary file of the same size and with the same content.
Note that it is not necessary to run avrdude as root or to fiddle with any udev rules. It just works.
So, this is why you buy multiple copies of a unit like this, especially when they are cheap. Even if you don't receive a dead unit like this, you can use one unit to update firmware in another (such as when AVRdude advises you to do so ....).
I had hoped this unit just had bad (or no) firmware, but it is simply dead. It will be discarded. I am glad I bought duplicate and backup units.
Tom's Light Info / tom@mmto.org