0

i am using arduino isp to program a ATtiny2313 avr microcontroller. Here is the probelm, when i was programming the avr chip using the default fuse values, everything worked just fine. But then, i changed the fuse bytes as i wanted to use an external 16 MHz crystal. When i changed the lfuse value from 0x64 to 0xff (as per the calculation of the fuse bits), the microcontroller stopped responding.

Now everytime i try to program the microcontroller using arduino uno isp, i get an error message : avrdude: Yikes! Invalid device signature. avrdude: Expected signature for ATtiny2313 is 1E 91 0A

and then the fuse bytes shown after verification, very strangely are all set to 0x00 : avrdude: safemode: Fuses OK (H:00, E:00, L:00)

i dont understand what the hell is happening and i have spent hours trying to figure out the probelm.

should the 16Mhz crystal be connected to the microcontroller while programming ?

PLEASE HELP !

ironstein
  • 421
  • 5
  • 16

2 Answers2

1

Yes. When you change the configuration bits to use the external oscillator, the internal oscillator is no longer utilised - including during programming. The chip is just stuck in reset until it is provided with an external clock signal. When the ISP attempts to read out a value it is just seeing the data line stuck in the reset state - which is where all the 0x00 values are coming from.

Hook up the crystal or a signal generator to the CLOCKIN pin and you should be able to talk to the chip again.

Jon
  • 496
  • 2
  • 8
  • is it okay if there is a LED connected from the XTAL pin to the ground while the oscillator is being used ? – ironstein Mar 17 '15 at 14:24
  • When you've configured the chip to use the external oscillator you can't use the XTAL pins for general purpose IO anymore, so you shouldn't connect anything else to them but the crystal. If you try to write to the PORT register to control the pin it won't work. – Jon Mar 17 '15 at 14:49
0

Had the same issue. If you do not have an external oscillator, you can use

Arduino ISP

On PIN9 you get an osciallator signal you can put on the target on PIN XTAL1.

Saved me two 328p.

Marc
  • 117
  • 1
  • 6