2

I have a ATmega328p chip from a kit that was supposed to be an Arduino compatible thing. I decided to go beyond Arduino and try to program the chip directly. I setup an UNO as an Arduino ISP, more or less like the image here, but added some LEDs to pins 8, 9 and 10 for feedback.

Arduino ISP

This image has this caption.

Because no external clock source is connected, the ATmega must be configured to use its internal clock.

I think this chip was flashed with whatever tells it to use an external oscillator. And I do not have an external oscillator.

So how can I tell the chip to again use an internal oscillator when using an UNO as my programmer?

» avrdude -p m328p -c avrisp -b 19200 -P /dev/cu.usbmodem1d11121

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

I assume a device id of zero means the chip is not responding with data? because it's core is not cycling?

Do I need an oscillator installed just so I can wake it it up and tell it to not use an oscillator?

  • If the chip was blank, it would be running at 1mHz. You'd need to lower the programming speed (avrdude -B10 ...). – Gerben Oct 27 '14 at 15:15
  • @Gerben Mega, not milli ;) – Klaus-Dieter Warzecha Dec 3 '14 at 9:48
5

Do I need an oscillator installed just so I can wake it it up and tell it to not use an oscillator?

Yes, yes you do.

Pick up a 8-16MHz crystal (not an oscillator) and two 15pF capacitors and use very, very short wires to connect them to the chip as shown in the "System Clock and Clock Options" section of the '328P datasheet. You will then be able to reprogram the fuses using AVRDUDE.

1

Even though an answer has been accepted, I just want to add for future viewers that you can google for arduino breadboard internal oscillator and get the text to copy into the boards.txt file. That will allow you to use the Arduino IDE to burn the fuses. You will be able to find versions to run at both 8mhz and 1mhz.

Also, if you have an extra Uno laying around, you could always pop the chip in there and reset the fuses, then take it out and use it on a breadboard.

  • 1
    But note that even though you will be able to do it via the Arduino IDE, you cannot set fuses through the serial connection; you must use ISP or HVPP in order to set fuses. – Ignacio Vazquez-Abrams Nov 5 '14 at 5:25

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.