I put an Atmega8u2 on a circuit board together with a crystal and an ICSP, plus power and some peripherals I want to control, including a Atmega328 (this part is similar to an Uno.) I also hooked up an USB connector, with TVS to ground and 22 ohm resistors. And the 1uF capacitor for the USB regulator. And pulling /RESET up to +5V through a 22k resistor.
I want to program this through ICSP. However, when using AVRdude, it fails to connect with Rc=-1.
I'm using an usbtiny. I can connect to the 8u2 on an Uno board, so the programmer and software are ok. I can also program the 328 through its separate ICSP so at least its clock and power is OK. That doesn't mean the 8u2 isn't hooked up wrong, but it means there's no systemic problem with the board.
I believe all the QFP legs are well soldered, and not shorted. I have tested what I can with an ohm meter, and it checks out. Yet ICSP doesn't see it, and it also doesn't answer when plugged into the USB of a computer.
The data sheet says it should come with internal RC clock, divided down to 1 MHz, so the crystal shouldn't even matter yet. What else can I have gotten wrong?
CrossRoads:
Maybe a stronger reset pullup resistor? You show a 22K with a cap to ground which will make for slow ramp up, most designs only have 10K & no cap.
I guess I can cut the cap and try it out. Thanks for the note!
I did take it out, but it still doesn't respond at all to the ICSP. (rc=-1, meaning the usbtiny finds "nothing there" on the SPI.)
You had my hopes up there for a while Thanks for your time, though, I appreciate it! More eyes are almost always better.
My only suggestion would be to check to see if you have 5v and GND where they belong when you power your standalone. It is hard to do with standard meter leads but, you can wrap a strand of wire on the end of a lead to help probe the small areas.
I tried with -i 1, 10, and 100 for SPI rate control. Rc=-1 for all.
It is possible I toasted the chip when soldering. I first tinned the pads, then positioned the chip and mashed one side at a time until it melted. My tip is set at 625 F, but the sensor is pretty far in, so I don't think it's as hot at the end.
Is the 8u2 super sensitive to solder heat? If I try to reflow on a hot plate or toaster oven, I'm not sure it will really be any cooler...
Have you removed the cap from the reset pin, it WILL mess the ISP programming, is MOSI connected to MOSI, MISO to MISO, CLK to CLK?
You should program at a max of 250Khz, but try slower, because the internal oscillator as some drift.
What programmer are you using?
And finally there is no Atmega8u2 available in DIP package, all USB enabled atmegas come in SMD packages, so you have either an atmega8 or an atmega88.
Senso:
Have you removed the cap from the reset pin, it WILL mess the ISP programming, is MOSI connected to MOSI, MISO to MISO, CLK to CLK?
I removed the cap, as I said above, and believe the signals are right.
You should program at a max of 250Khz, but try slower, because the internal oscillator as some drift.
What programmer are you using?
As I said above, I tried -i 10 (100 kHz) and -i 100 (10 kHz). I'm using an usbtiny.
And finally there is no Atmega8u2 available in DIP package, all USB enabled atmegas come in SMD packages, so you have either an atmega8 or an atmega88.
No, I have an atmega8u2 in TQFP32 - I did mention the QFP and USB above. I described tinning the pads before positioning the chip, and talked about the heat of reflow in comparison with hand soldering.
So, thanks for the advise; I had taken it all already
I know this is an old thread, but if you're still struggling with this, maybe this will help. I managed to pull this off yesterday. I was able to program an atmega8u2 on a breadboard (with a breakout PCB) using an AVR ISP mkII programmer. I tested it by loading the Blink example onto an atmega326-PU that had the Uno bootloader on it.
My circuit is a bit different from yours. I'm using USB bus power and I think the reset pins are handled a little differently. I've attached a pdf of the Fritzing breadboard. I should be documenting this better sometime soon.