I bought one of these in April of 2013. One thing I like about buying things from Adafruit, is that they toss in the header pins for the programming interface and for the pins along the edges of the board. The pin spacing on this module is such that it can be plugged into a "standard" breadboard, which is very nice -- and a strong reason to buy this instead of something like a "pro-micro" from Sparkfun.
It runs at 16 Mhz. There is a programmable green LED and a very bright red power LED. When the bootloader is active, the green LED "breathes" (it doesn't just blink).When I plug mine in, I see:
New USB device found, idVendor=239a, idProduct=0001 usb 2-1.8: New USB device strings: Mfr=0, Product=1, SerialNumber=0 usb 2-1.8: Product: AVR CDC Bootloader cdc_acm 2-1.8:1.0: ttyACM0: USB ACM device
The description claims that the bootloader will run for about 10 seconds after reset. It seems more like 5 seconds, and later perusal of the BootLoader source confirms that the timeout is indeed 5 seconds. After this time, the bootloader times out and your code will run. The game then to load new code is to press the reset button and then (in my case) type "make load" before 5 seconds is up.
Also, I note that when I first plug in the device, it immediately runs my code. To get to the boot loader, I have to hit the reset button. This is actually quite nice. (I like this a lot better than the Sparkfun pro micro where you have to do weird things with the USB pseudo buad rates to get the boot loaders attention).
The "device programmer" is "avr109", so an avrdude line like this should work:
avrdude -p m32u4 -P /dev/ttyACM0 -c avr109
[tom@trona blink_micro]$ avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 Connecting to programmer: . Found programmer: Id = "LUFACDC"; type = S Software Version = 1.0; No Hardware Version given. Programmer supports auto addr increment. Programmer supports buffered memory access with buffersize=128 bytes. Programmer supports the following devices: Device code: 0x44 avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e9587 avrdude: safemode: Fuses OK avrdude done. Thank you.To build the blink demo, I use a makefile, which ultimately does this to build the image to download:
avr-gcc -mmcu=atmega32u4 -Wall -Os -o blink.elf blink.c avr-objcopy -j .text -j .data -O ihex blink.elf blink.hexThe following line then loads the image
avrdude -p atmega32u4 -c avr109 -P /dev/ttyACM0 -D -U flash:w:blink.hex:i
#if BOARD == BOARD_ADAFRUIT32U4 #define BOOTLOADERLED_DDR DDRE #define BOOTLOADERLED_PORT PORTE #define BOOTLOADERLED 6 #endifGiven this, I modify my blink demo and I am blinking the LED!
I wonder how the bootloader gets a nice "breathing" effect to the blinking LED brightness, and a bit of study of the source code shows they are doing a clever software driven PWM of the bit controlling the LED, slick!
git clone https://github.com/adafruit/lufa-lib.gitThis is the LUFA source tree, with what look like straightforward modifications to two files.
The main bootloader file is modified to blink the LED:
lufa-lib/trunk/Bootloaders/CDC/BootloaderCDC.cThe only other file that I have found modified is: lufa-lib/trunk/Bootloaders/CDC/Descriptors.c as follows:
.VendorID = 0x239A, // Adafruit VID for our use only, thanks! .ProductID = 0x0001, // #1 is the USB CDC (bootloader)
Tom's Computer Info / tom@mmto.org