Hey everyone!
I've come across a bit of a problem trying to get a 16u4 based leonardo clone working (Due to the worldwide lack of the 32u4 and a tight deadline, sadly). I've built the board and am using a mega as my ISP programmer. I'm testing with a real leonardo side by side and IT works perfectly - my board can talk to the programmer, set fuses and lock bits, write read and verify the flash...but for some reason, the code never actually runs. Details below.
-Both boards run at 16 mhz and have the same fuse settings (l:0xff h:0xdf e:0xcb)
-My sketch sets all of my boards' output pins to output using DDRx, then turns them all on using PORTx. That's it.
-I've used my mega to turn my leonardo into a bootloaderless fuse-clone of my board, so that the chips are effectively identically configured. It runs anything I care to put on it flawlessly...
-...but when I use the same mega to upload the same code to my 16u4 based board, the damn code doesn't run! The code loads fine, and verifies. I can change the fuses or lock bits, erase the chip, whatever I want. Everything works fine, EXCEPT that the code doesn't actually work!!! Wether I reset it, cycle the power, or re-upload the code...all the pins stay low, as if the chip was lifeless.
-I KNOW The 16u4 is correctly rigged/configured, because I can upload sketches to it. If nothing else, it should be able to bring MISO high, right?
-I'm using avrdude to upload the code arduino 1.0.5 compiles for a leonardo board. I've cleverly tricked everything into working by changing JUST the avrdude config file for the 32u4 to have the 16u4's memory locations. The chips share a datasheet and are otherwise identical, and I'm not using a bootloader, so doing this should be fine, right? The code is barely 4k anyways...
If anyone has any idea whatsoever what could be causing this, that would be fantastic! I can TALK to the bloody chip, change it's fuses, upload code to it...why doesn't it run?! :0
Cheers,
Dennon