2
\$\begingroup\$

I have been programming an ATMega644PA with avr-gcc and avrdude on linux for a little while with no problems. Well until I decided to change some fuses. I had been using the option for avrdude -p ATMEGA644P for programming the chip even though the chip is ATMega644PA.

After reading the data sheet (and reading the fuses on the chip) I did the following

avrdude -v -c avrispmkII -p ATMEGA644P -P usb -U lfuse:w:0x63:m

The chip would no longer communicate. I realized after that the problem may have been that I set the bits for external clock rather than crystal oscillator but even with using an ATTiny to generate a 1MHz signal to the proper pin on my Mega644, I still get nothing.

Any ideas as to why the chip is unresponsive? Could it be that using avrdude's definition for the P version of the chip rather than the PA version is the cause?

And finally, What can I do to rescue my chip? Ive heard that it may be possible with High voltage programming or JTAG. Would I be able to do that with an STK500?

\$\endgroup\$
5
\$\begingroup\$

Nope, your 0x63 setting on the lfuse byte has selected the internal 128kHz oscillator as the clock source. (bytes 3..0 are CKSEL, see table 7.1 on p.28 of the ATmega644 datasheet where 0011 is 'Internal 128 kHz RC Oscillator'). This is nice and low power, but it means that your programmer likely isn't clocking itself slowly enough to program your device. I'm not familiar with either avrdude or the STK500, but this is where your problem is coming from.

However, it will be difficult for you to brick your chip, because you've got the STK500, which can do high voltage programming and rescue it from most situations. As I've never used the device, I'll defer to the many other threads where others have posted problems and solutions for AVR fuse settings. There's also one here on Chiphacker (see my comment.)

Next time, this fuse setting calculator is a nice resource. It's fantastic that you read the datasheet, and tried to calculate what you wanted yourself, but the tool makes it much easier.

BTW, what were the fuses set to before you made the change?

Edit: Looks like the 'A' option just indicates that it's not a member of the "*P*ico Power" series, so that shouldn't make a difference.

\$\endgroup\$
  • \$\begingroup\$ the lfuse was origally set to 0x64. Thanks for that fuse calculator link, a great resource indeed. \$\endgroup\$ – C-o-r-E Jun 21 '10 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.