1
\$\begingroup\$

I'm new to electronics.

I've bought an ATmega32 (a link to docs) and I'm trying to light up a single LED. I have managed to do it a few times, but then I tried to change the hookup wires to a single 10 pin wire and after a few failures, I went back to wires.

The problem is, when I try to program the device, it gives me a warning:

WARNING: FLASH byte address 0x0000 is 0x00 (should be 0x0C).. FAILED!

When I read the signature of the device straight after plugging it in, it says it's

0x1E 0x95 0x02

and it says it matches the device.
Then when I try to erase it (or program it), I got the mentioned warning. Also, after doing this, when I read the signature of the device, it reads it from the device as

0x00 0x01 0x02

There's also a warning that 'signature does not match selected device'.
I can erase the device and it says that erasing device was OK.

I'm not sure if that's relevant or not, but I've also realised that fuse bits (low to high) are at the beginning 0xE1 0x99 and later 0x04 0x04 and after erasing it changes the

SUT_CKSEL Int. RC Osc. 1 MHz; Start-up time: 6 CK + 64 ms; default value

to

SUT_CKSEL Int. RC Osc. 8 MHz; Start-up time: 6 CK + 0 ms

(it also changes some other fields there as well, e.g. brown-out detection from VCC=2.7V to 4.0V)

I'm using AVR Studio 4.18.716, and a JTAG ICE programmer.

Is there anyway I could fix this or have I killed it?

\$\endgroup\$
  • 2
    \$\begingroup\$ Could you elaborate on this statement "I tried to change the hookup wires to a single 10 pin wire and after a few failures, I went back to wires"? I'm not sure if I follow. \$\endgroup\$ – DigitalNinja Aug 31 '15 at 23:21
  • 1
    \$\begingroup\$ Why are you using an ancient version of AVR Studio? Its not even called that any more... I imagine some of these would go away with just updating. With that said could you please elaborate on what DigitalNinja said, or give us a schematic of how you have this Atmega hooked up? More often than not, the issue with these kinds of problems is the wiring. \$\endgroup\$ – Funkyguy Sep 1 '15 at 0:13
  • \$\begingroup\$ @DigitalNinja I basically had everything connected with these, but it didn't look nice, so I wanted to change to this. I did this a few times with a few different combinations and it didn't work, so I wanted to go back with my setup. \$\endgroup\$ – Juras Sep 1 '15 at 18:26
  • \$\begingroup\$ @Funkyguy the reason I'm using the ancient version of AVR Studio is that my friend told me that my programmer - AVRJTAG ICE V2.0 wouldn't work with the later versions of AVR studio. I bought that one because he said it's good and cheap. \$\endgroup\$ – Juras Sep 1 '15 at 18:34
  • \$\begingroup\$ @Juras hm very interesting. I'm sure it would work but it may take a little encouraging :) I'll get one and see if I can get it to work with the newer versions. If I did it with the USBasp, can probably do it with this one as well. I'll shoot the instructions your way if I get it working. \$\endgroup\$ – Funkyguy Sep 1 '15 at 18:47
1
\$\begingroup\$

Most likely you are running the programmer at too high of a bit rate. The bitrate can be set on the command line with the -B N flag, where N is the period of the programmer SCK signal in microseconds. Try something high like -B 100 and see if you get more consistent results. The following link seems to show how you would set this up in AVR Studio (v4): Atmel STK500 Programming.

\$\endgroup\$
  • \$\begingroup\$ Were you able to get this to work by changing the bitrate? \$\endgroup\$ – theorifice Oct 21 '15 at 7:21

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.