My bare-bone ATMEGA32U4 system is having a hard time getting programmed by Arduino IDE.
Here is what I have:
1 ATMEGA32U4 on a TQFP-44 adapter board from adafruit, on a breadboard
16MHz crystal with 22pF caps
HWB_bar pin is grounded
Arduino pin 13 has LED + resistor to GND
D+, D-, UGND, VUSB connected to a USB cable I found from spare part
I have a 0.1uF cap on the UCAP instead of 1uF the Micro has.
Programmer wise I have an arduino UNO with Nick Gammon's Hex loader:
Successes:
- I loaded caterina Micro bootloader with Nick's hex loader. The LED on pin 13 blinks after this. It also enumerated a serial port saying "Arduino Micro" on my device manager.
- I loaded a blink sketch that I compiled for arduino micro with Nick's hex loader. I set the pin 13 led to blink quickly. It worked. It also enumerated a serial port saying "Arduino Micro" on my device manager.
Failure:
- Although I loaded the bootloader, I can't program it using Arduino IDE. The serial port disappears during programming but the IDE reports it can't find a Leonardo.
Can someone help? Thanks.
Also here is the fuse settings with bootloader loaded:
LFuse = 0x5E (bit 7: divide clock by 8 is zero, or programmed. Change to 0xDE)
HFuse = 0x99
EFuse = 0xF3
Lock byte = 0xFF
Clock calibration = 0x5D
I read about the HFuse. I think it should be 0x98 to make the bootloader run but Nick's program won't let me change it. It was 98 when I first loaded a bootloader but changed to 0x99 after I loaded blink.
Also I had to change LFuse from 0x5E to 0xDE so that the freq/8 option is turned off. I just can't do the HFuse with Nick's code.
And, something seems wrong: Caterina-Micro.hex is 76KB. That is like 16KB of code. That is a real program!!! There is something wrong with the size. The Caterina lilypad USB is only 4KB with 12KB HEX. This is what I expected:
~~http://arduino.cc/en/Main/ArduinoBoardMicro~~
It says 4K is used by bootloader.
OK, I took another look at the Caterina-Micro.hex. It does have 4KB in the end, 4,832 bytes in the beginning and just empty space in between, making up not 16KB, but 32KB of program space. So what is the purpose of the first 4,832 bytes? Is the bootloader area not large enough so it spills over to this memory location? I read the relevant info from boards.txt
Nick's program has the following:
// Atmega32U4 family
{ { 0x1E, 0x94, 0x88 }, "ATmega16U4", 16 * kb, 512, 128, highFuse },
{ { 0x1E, 0x95, 0x87 }, "ATmega32U4", 32 * kb, 512, 128, highFuse },
I don't understand why the ATMEGA32U4 has only 512 bytes of bootloader size. Is this a mistake?
How do you flash bootloader on your ATMEGA32U4? I'm frustrated.
Damn! I shouldn't have used Nick's code! I followed this tutorial and used UNO to bootload the ATMEGA32U4. It worked!
http://murchlabs.com/monday-experiment-bootloading-an-atmega32u4-with-arduino/
I don't know why the cap between host Arduino RESET and GND is needed but as long as it works. I don't complain. I still think that somehow if I can make Nick's fuse setting more flexible then I can get it to work too.
I wonder which bootloader is used.
I also wonder what fuses the arduinoisp set my chip to. Too lazy to rewire it to run Nick's code. 
In the future I need to recompile the bootloader to use my own VID (if I can afford) so I'll have to find the right code soon. Any hint?