No program execution on ATMEGA32U4

Hey guys, what I am trying to achieve is to build a display using 52 RGB-LEDs, controlled by an ATMEGA32U4. I would also like to be able to use the Arduino-IDE, so I flashed the Leonardo bootloader (Caterina-Leonardo) onto it. The schematic of the microcontroller can be seen here: Keep in mind that some caps between +5V and GND as well as a cap between VBUS and GND are not shown on the image but are on the board. The board itself is manufactured and 100% tested. I also tested all of the connections of the microcontroller with my multimeter, and everything seems to be ok.

So the problem is, if I connect it to my PC, it isn't recognized as an USB-Device, or recognized at all. I then measured the D+ and D- lines of the microcontroller, but their signal doesn't seem right (at least it doesn't look like it should, some digital signal):

I can flash the microcontroller, and when I set CKOUT then I can also measure the clock on PIN7, so at least not everything seems to be wrong.. Here are the Fuses I tried, as I found them on another project that was successfully using the ATMEGA32U4:

The output of a test program that just sets some Pins to HIGH is the following: So obviously there really is something wrong..

Any ideas what might cause this? Are the fuses ok? Is there something else I could test or measure when I am back in the lab tomorrow?

You can compere the schematic with the Leonardo schematic : http://arduino.cc/en/Main/arduinoBoardLeonardo Use a programmer to write the bootloader with the Arduino IDE, that sets all fuses and so.

I have to admit that I copied a bit of the schematic of the Leonardo, at least for the microcontroller part.
Programming via the Arduino IDE sounds like an idea I could try when I get to the lab, thanks.

I think I forgot another question:
What should I set the HWB-Pin to when using an Arduino-bootloader on the chip? Floating (so not connected) or via a resistor connected to ground?

I have not heard about the HWB pin before :blush: In the Leonarde schematic it is pulled down to GND with 10k. So I suggest to do that.

You can have a look in boards.txt arduino-1.5.7 / hardware / arduino /avr /boards.txt That is the definition for all the boards, and it shows the fuses that Arduino IDE uses for the Leonardo and Micro.

I found another Arduino Leonardo and copied the memory and eeprom to my board but nothing changed :/ Not even the LED connected to the HWB-pin shows any sign of action, so still no execution.

I then compared all pins and noticed, that while on the original Arduino Leonardo the UCAP-Pin is on a constant 3.2V, whereas my Pin starts at about 1.2V, slowly falling down to 0V. Could that be the cause of my problems? And what might be causing this? On a no-name "Leonardo", they just did it like me and connected UCAP via a 1uF-cap to GND and they still get 3.2V...

Yes, UCAP should be 3.3V. When it is not used, many still use a capacitor to ground. But I don't know if the USB has to be switched on, to get UCAP working.

Copying the memory and EEPROM is not enough, there are also fuses and so. Using the Arduino IDE with a programmer set everything right.

By "copied" I meant I wrote down the fuses and lock-bits from the original (noname) leonardo and flashed them onto my board. But by using the Arduino-IDE at least there is a constant 3.2V now on the UCAP-Pin, but still no program execution (LED on PIN13/HWB doesn't blink) and the device is still not recognized, meaning there is no USB-connection still.

Could it be that the microcontroller is just damaged after all? Could I still flash a damaged microcontroller without problem that wouldn'T execute any program on it, just like mine does?

Yes, that is possible. You need another chip to test to be sure.

When an ATmel ATmega chip is damaged, sometimes only a part is blown. For example if a single analog input is blown, the whole analog section could be damaged while the rest is still working. I guess it is the same for the USB hardware inside the chip.

I do have another chip, but I can’t get the old one out without destroying it i think.
Is there anything I could try or test to make sure something is damaged to justify soldering another microcontroller onto my board?

I'm out of ideas, sorry. It's a big risk, and you don't know yet what is wrong. Can you make a new controller with a new chip ? or strip a Leonardo or Micro until it is like your controller ?