3

I've got a setup with an ATMega32 running perfectly. When replacing the ATMega32 with a ATMega32A, nothing happens any more, not even the crystal oscilator swings. According to the changenote from Atmel, the reset pull-up resistor has a good value and the pull capacitors next to the crystal are also in place. I tried with many different parts (all from one shipment) of the ATMega32A, always the same behaviour. Changing back to the ATMega32 everything is fine again.

Finally I setup a circuit only with the AVR, reset pull-up, crystal and pull-capacitors. ATMega32 works (crystal swings), ATMega32A does not work (crystal swings not).

Could you think of anything but all ATMega32A I have in the lab are broken?

Trygve Laugstøl
  • 1,410
  • 2
  • 19
  • 28
wollud1969
  • 494
  • 1
  • 5
  • 12
  • I've experienced something similar when trying to drop in a 164A in place of a 164P: http://electronics.stackexchange.com/questions/15760/how-do-you-determine-if-a-new-microcontroller-is-defective I never found out what the issue was – Jon L Aug 31 '12 at 15:51
  • 2
    Have you checked the fuse bits between the two? – dext0rb Aug 31 '12 at 15:59
  • You mustn't exclude the possibility that you might have zapped your ATmega32A with [ESD](http://en.wikipedia.org/wiki/Electrostatic_discharge). – m.Alin Sep 01 '12 at 19:22
  • @m.Alin Sure, I think I should get some more parts of this type from a different source for double checking. – wollud1969 Sep 03 '12 at 09:37

4 Answers4

4

You haven't mentioned fuse bits anywhere - you may have to set the ATmega32A fusebits to the proper values. That's usually the issue when the oscillator doesn't work. The two devices may have fuse bits set for different oscillators and/or startup times.

Christoph B
  • 2,818
  • 1
  • 14
  • 26
  • 2
    I looked at the datasheet between the two - datasheet claims they both have the same default clockbits set. But if you go to http://www.engbedded.com/fusecalc/ and look, 32A has fuse bits low 0xF1, 32 has fuse bits low 0xE1. Maybe I read the datasheet wrong... – dext0rb Aug 31 '12 at 17:18
  • You are right, I completely forgot about the fuses. I reread the datasheet and tried to read out the fuses using avrdude but I couldn't even read them. Is this the correct behaviour of the chip when the clock is not running? Maybe I have to connect an external clock source and try to read (and write) the fuses that way. – wollud1969 Aug 31 '12 at 21:19
  • 1
    iirc with the wrong oscillator settings you have to tell avrdude to communicate extremely slowly – Chris Stratton Sep 01 '12 at 19:50
  • @ChrisStratton I put a 1MHz signal on the oscillator input of the chip and tried to read the fuses - without success. I think I should first get some more parts of this type from a different source for double checking - as mentioned above. – wollud1969 Sep 03 '12 at 09:39
  • 1
    You could have fakes; but if you have a genuine device which has somehow had its fuse bits set to run off the 32 KHz internal oscillator, you would need to set avrdude to talk even slower - see for example http://www.evilmadscientist.com/2007/fixing-a-bad-frequency-fuse-bit-on-an-avr/ – Chris Stratton Sep 03 '12 at 12:01
0

Hi for my ATMEGA32A PU this helps:

avrdude -c usbasp -p m32 -B 3

To write a hex file to micro-controller I use:

avrdude -c usbasp -p m32 -B 3 -U flash:w:Program.hex
MaciejLisCK
  • 101
  • 2
0

Even though the specs are the same, you might get different behaviors when running the parts slightly out of spec, due to different manufacturing processes. For example, if your loading capacitors on the crystal weren't quite in the right range, the ATmega32 might have worked anyway, while the ATmega32A could be more picky. Same with voltage, supply current, supply noise, timing constraints on the programmer, etc.

Jim Paris
  • 2,685
  • 1
  • 12
  • 12
-1

Finally, I found what was going wrong and it was completely my own fault, and it was Chris Stratton who gave the important hint.

Older AVR devices have been configured with the fuses to work with an external crystal. Newer ones are configured to work with the internal oscilator. This one is indeed much slower and my avrdude was simply talking to fast ... that was also the reason why I wasn't able to read or write the fuses. After finding the -B switch of avrdude everything is fine again.

Thank you again to everyone answering and commenting here.

wollud1969
  • 494
  • 1
  • 5
  • 12