After two weeks of reading forums and instructions, I've had no luck programming ATMegas. I am trying really hard to program the ATMegas on a breadboard using my Arduino as ISP. If this is possible, then what is the point in buying a USB chip programmer? Here's roughly what I've done (skip ahead to questions if you're busy / a super genius!):
Originally, I didn't have a crystal oscillator so I wanted to use the 8MHz internal clock by disabling the divide-by-8 bit and using my Arduino as the external clock. Thanks to some advice, I downloaded Nick Gammon's well-written Chip Programmer sketch off of his website http://www.gammon.com.au. I highly recommend this as a bootloading method for anyone who is just starting, and while I believe it worked (the output verified no errors) I'm not entirely sure.
I finally gave up on the 8MHz internal clock because the chip was seemingly doing absolutely nothing. I bought a 16MHz crystal oscillator and two 22pF capacitors as recommended by most of the Arduino as ISP tutorials. I hooked them up as instructed. First I tried the bootloader via the Arduino GUI; no luck. Back to Nick Gammon's bootloader, this time uploading the Uno (16MHz) sketch, and for the first time there is a sign of life. Chip pin d13 (pin 19?) was blinking slowly. With no sketch uploaded thus far, I read that this was the bootloader indicating it was "ready." Great!
Before uploading any sketches, I bootloaded 3 more chips because this is what I assume needs to be done before you can upload sketches (I have since read otherwise?). After bootloading the rest, I noticed that the clock byte in the serial monitor was different for each chip. This was my first indication something is not right, but maybe that is normal. I have no idea. The chips inexplicably no longer blinked pin d13, not on external power, and not on Arduino pin-power (with Arduino powered by USB).
- I'm sure the chip has been wired correctly to the Arduino, I have tried both the standard MISO/MOSI/SCK/G/VCC pins and the ICSP variety on my board.
- I have an OSEPP Uno R3 Plus board that I'm using as my programmer. The ATMega on it cannot be easily removed. I have been using a capacitor between reset and ground (although Ive tried other suggestions such as jumping reset to ground, and a resistor between reset and ground).
- I've tried programming the board chip by having the ISP sketch on the Arduino, and then uploading a sketch using the AVRDUDE command line because I read that I might have to use a specific baud rate (19200?). Didn't work (although something responded!).
- I can't think of anything else that tutorials have suggested, but chances are I've tried it.
[u]Questions![/u] 1. I read that mishandling chips can "zap" them, which I assume is a cute way of saying "destroy." Is there any way to tell if the chips are completely bricked? I have handled them carefully with rubber clips so I doubt this is the case.
Almost every error it has spit out so far is out of sync, although I think after using the avrdude command line for the right baud rate, I believe the error was invalid signature. Does the baud rate my PC is outputting have to match the expected baud rate of my Arduino, the chip on breadboard, or both?
If I do give up and buy a USB chip programmer, what are the chances it will succeed at programming the ATMega vs. Arduino as ISP? I have read about an equal amount of success/fail stories using USB programmers as I have Arduino as ISP stories.
Are there any other simple alternatives to the ATMega that I could program using my Arduino in order to get a programmed chip inside a project I'm working on? I know there are lots of microcontrollers out there and at this point I'd love to try anything other than hooking up the same chip the same way and getting the same error.
Thanks in advance to anyone who can offer any help! I'm sure everyone's been here at some point because there are endless threads about this, but everyone has such a different setup that the solutions will vary just as much. I think the only thing unusual about my setup is the OSEPP Arduino, maybe, or possibly that I'm using the most recent Arduino IDE? I have no idea. I can fill in any details that I forgot to mention here, just ask.