0
\$\begingroup\$

I have noticed this strange thing where my atmega328p stops working and when checked through Arduino IDE or AvrdudeSS or ProgISP, they show programmer not in sync, rc=-1 initialization error (while the same circuit recognizes a new chip).

EDIT3: Zener removed form schematic as the problem exists even without the zener. enter image description here My circuit has a 12volt input coming from an adapter, then to 7805 and 7805's 5v output to my atmega chip. The circuit worked all fine until 7805 was moved a bit by jerk and all becomes hell, atmega stops. Is it permanent damage? I am unable to understand what is it and my money is wasted on buying new chips and demoralizing me to continue.

EDIT: I must also mention that one of my chips died in the same way while I just had an led tested with the chip's 5volts. All I noticed is a "jerk" to 7805 did it (switched-off the led and then the chip stopped responding to anything)

EDIT2 - Is it possible that fuses go wrong if chip resets due to jerk on voltage regulator or anything similar? I know it sounds silly. I always burn bootloader on my new chips using usbasp and Arduino IDE 1.0.1 and then set fuses using AVRDUDESS default fuses for Arduino Uno (L 0xFF H 0xDE E 0xFD, after which blink program blinks at normal rate).

\$\endgroup\$
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. Any conclusions reached should be edited back into the question and/or any answer(s). \$\endgroup\$ – Dave Tweed Jan 9 at 21:55
3
\$\begingroup\$

I noticed is a "jerk" to 7805 did it

Any interruption in the 7805's ground connection would result in the 12v input being applied to the downstream circuitry, resulting in immediate damage.

You really need to arrange things such that a "jerk to the 7805" is not possible, ie, solder the connection or use a good connector in a way that it is not under mechanical stress. Generally speaking, you're better off with a regulated power supply built in some lasting way, not on a breadboard or temporary improvisation.

\$\endgroup\$
  • \$\begingroup\$ "Any interruption in the 7805's ground connection would result in the 12v input being applied to the downstream circuitry, resulting in immediate damage." Do you mean that 12v will be supplied to the output side of 7805 in that case? This is horror to hear and now I feel like my chips are not soft bricked but damaged. I was thinking to buy a high voltage programmer to see if my chips can be recovered (although the programmer is so expensive and I dont know which one to buy) \$\endgroup\$ – J J Jan 8 at 18:58
  • \$\begingroup\$ @JJ Yes, 12V (edit: well, at least a higher voltage than it's supposed to output, as bruce points out in the other answer.) will be supplied to the output if the ground is lost. Just connect the regulator better. \$\endgroup\$ – Hearth Jan 8 at 19:28
  • \$\begingroup\$ Thank you, Hearth, I will keep this in mind and practice now \$\endgroup\$ – J J Jan 8 at 19:31
2
\$\begingroup\$

The zener diode is connected the wrong way. Instead of being in series with the atmega it has to be in parallel, with the cathode connected to 5V and the anode connected to ground.

In your case you don't really need a zener diode, because the 7805's voltage should be pretty stable (linear regulator) and I would say "paranoia" is not an argument ;). That would be different if you use a switching regulator, where a zener might be usefull to clip the regulator's ripple.

Also note that zener diodes are not meant to dissipate much power. Using them to limit a PSU's constant voltage (like in your case) would either have no effect (when the voltage is below the zener voltage) or would lead to a continuous (unlimited) current through the zener, which will probably destroy it. That's why you usually have to apply a current limiting series resistor. This series resistance is undesirable for a power supply and that's why the zener approach is not the way to go.

\$\endgroup\$
  • \$\begingroup\$ I agree. Introduction of zener was just due to my paranoia of overvoltage and I accept that I didnt know how to use it anyway. But the chips failed even with or without zener (so I edited my post to be without zener now). I dont know what is wrong but I am losing money and I am almost near to stop working for a commercial project I was motivated to do. Who would want to sell a product with bad circuit and failing chips! \$\endgroup\$ – J J Jan 8 at 18:23
1
\$\begingroup\$

The circuit worked all fine until 7805 was moved a bit by jerk and all becomes hell, atmega stops. Is it permanent damage? I am unable to understand what is it and my money is wasted on buying new chips and demoralizing me to continue.

'Jerking' the regulator should not have any effect, unless one or more pins has a poor connection. If the GND pin becomes disconnected then the regulator will put out ~4V less than the input voltage, in this case ~8V. The ATmega328p is rated for an absolute maximum operating voltage of 6V, so at 8V there is a good chance of permanent damage.

Is it possible that fuses go wrong if chip resets due to jerk on voltage regulator

Yes. The 'fuses' are actually FETs with floating Gates, which are programmed by applying a high voltage that forces charge onto the Gate. A technique commonly used to break MCU protection is to 'glitch' the IC with a high voltage spike, in the hope that the protection fuses will be reset. Of course this often destroys the whole chip, but if you have enough of them then you may eventually get lucky.

The ATmega328p has several fuses controlling oscillator configuration, plus one that disables in circuit serial programming. This makes it quite vulnerable to being 'bricked' by incorrect fuse settings. If the fuses have changed then you may be able to reset them with a 'high voltage' programmer.

AVR High Voltage Programming (Fuses Rescue)

\$\endgroup\$
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. Any conclusions reached should be edited back into the question and/or any answer(s). \$\endgroup\$ – Dave Tweed Jan 9 at 21:55
1
\$\begingroup\$

I don't see how it can even work to begin with. Based on the schematics, the AVR is completely missing the AVCC power supply connection. And lack of proper bypass capacitors at AVR supply pins can cause problems too.

\$\endgroup\$
  • \$\begingroup\$ Hi Justme. I am sorry for the schematics as it is my first time with Proteus. However, in real-life, the dc jack receives 12volts input from an adapter, and this 12v is fed to 7805, from which I am taking 5v output to the atmega chip and it works. The only problem so far is chips dying. \$\endgroup\$ – J J Jan 9 at 2:46
  • 1
    \$\begingroup\$ Don't be sorry, but if you built it in real life exactly like in the schematics, in real life the circuit will have problems. If the chip works fine in a simulator with only half of the supply voltage pins connected and without bypass caps, in real life it doesn't work fine. It also matters how you built it, is it soldered on a real PCB or some kind of prototyping board with loose components? PCB design also matters in real life, i.e. how are components located and how long and wide traces are used to connect them. \$\endgroup\$ – Justme Jan 9 at 6:10
  • \$\begingroup\$ Hi Justme. In real-life circuit, the 7805 is serving as an input supply and connected to all the pins which show power and ground labels in schematic. So far, I am using it on breadboard which caused the microchips to fail in the first hand due to 7805. I am preparing to order pcb and was testing this finally when my chips starting failing again and lost my confidence. \$\endgroup\$ – J J Jan 9 at 6:41
  • 1
    \$\begingroup\$ That's not what I meant. AVR AVCC supply input pin, pin number 20, is disconnected, right? Don't do that to your chip, connect it properly to 5V. And put 100nF ceramic bypass capacitors between supply and ground at each chip. In real life these things matter. Simulator does not care if power supplies or bypass caps are missing, because you have ideal chips and power supplies and wires. \$\endgroup\$ – Justme Jan 9 at 6:59
  • 1
    \$\begingroup\$ No it is not a sufficient. The 1000uF caps are bulk electrolytic caps, not good at high frequencies. And at least the 7805 output cap seems to be quite randomly and excessively rated at 1000uF, while a smaller one would suffice. But you need ceramic 100nF bypass caps that are good at high frequencies near every power pin at every IC (AVR and 7805). Especially if you have a breadboard or poorly designed PCB. \$\endgroup\$ – Justme Jan 9 at 10:46

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.