is this hack to power ATMega from an external supply safe?

I bent up the VCC and AVCC pins, chopped traces on cathode (5V) side of D2 and the 10k resistor, and soldered wires to all of them to connect to an external 5V supply. This supply has common ground with the Arduino. I did this to keep the ATMega always on from a low-power regulator.

I believe this is safe as long as the rest of the board is always powered up before any ATMega pins are de-tri-stated. I've removed the bootloader (using ISP instead) so programming doesn't violate this.

What I do wonder about is the connection from RESET to pin 13 of the ATMega16U2 via a 10k ohm and capacitor C5. I think between the 10k resistor and C5 which should block the DC to the un-powered ATMega16U2 any momentary hit to that pin should be absorbed by it's protection diodes without a problem. Is that true?

Can you show the schematic with numbered components you are taking about?

What I do wonder about is the connection from RESET to pin 13 of the ATMega16U2 via a 10k ohm and capacitor C5. I think between the 10k resistor and C5 which should block the DC to the un-powered ATMega16U2 any momentary hit to that pin should be absorbed by it's protection diodes without a problem. Is that true?

Look again. The 10k resistor is the Reset pin pullup and is NOT in SERIES with the trace going to pin-13.
and C5 is probably used to reset the processor after uploading a sketch. As you can see, the cap is in series
with a 1k resistor to GND. With the Reset pin on the right side and the resistor to GND on the other side, it would
appear the cap is acting as a decoupling cap . The series RC (1K, 100nF) constitutes and RC time constant of
100uS (0.1mS). I would guess U3 sends the reset pulse after receiving a sketch upload, but that's just a guess.

I bent up the VCC and AVCC pins, chopped traces on cathode (5V) side of D2 and the 10k resistor, and soldered wires to all of them to connect to an external 5V supply. This supply has common ground with the Arduino. I did this to keep the ATMega always on from a low-power regulator.

You'll loose the bypass capacitor C6 ... should probably add a 0.1µF ceramic cap from the bent up VCC and AVCC pins to GND. D2/10K are part of the DTR auto reset circuit ... reconnected to external 5V is OK.

What I do wonder about is the connection from RESET to pin 13 of the ATMega16U2 via a 10k ohm and capacitor C5. I think between the 10k resistor and C5 which should block the DC to the un-powered ATMega16U2 any momentary hit to that pin should be absorbed by it's protection diodes without a problem. Is that true?

Same DTR auto-reset circuit as above. . When DTR returns high, the protection diode clamps the signal to about 5.3-5.5V.

Yeah, you don’t want to lose decoupling, that’s potentially going to cause weird and hard to
understand eratic behaviour that’s pattern-sensitive - a debugging nightmare. Decoupling
caps need to be close to the pin as possible too…

raschemmel:
Look again. The 10k resistor is the Reset pin pullup and is NOT in SERIES with the trace going to pin-13.
and C5 is probably used to reset the processor after uploading a sketch. As you can see, the cap is in series
with a 1k resistor to GND. With the Reset pin on the right side and the resistor to GND on the other side, it would
appear the cap is acting as a decoupling cap . The series RC (1K, 100nF) constitutes and RC time constant of
100uS (0.1mS). I would guess U3 sends the reset pulse after receiving a sketch upload, but that's just a guess.

It is in series with it starting from the 5V, which is the concern. The 5V rail above the 10k and diode D2 is getting replaced with a new source that's on when the ATMEGA16U2 isn't. But the 10k should limit any initial burn before C5 gets charged, which should happen pretty fast. So I think the ATMEGA16U2 protection diode should be able to handle it.

bkerin:
I bent up the VCC and AVCC pins, chopped traces on cathode (5V) side of D2 and the 10k resistor, and soldered wires to all of them to connect to an external 5V supply. This supply has common ground with the Arduino. I did this to keep the ATMega always on from a low-power regulator.

I believe this is safe as long as the rest of the board is always powered up before any ATMega pins are de-tri-stated. I’ve removed the bootloader (using ISP instead) so programming doesn’t violate this.

What I do wonder about is the connection from RESET to pin 13 of the ATMega16U2 via a 10k ohm and capacitor C5. I think between the 10k resistor and C5 which should block the DC to the un-powered ATMega16U2 any momentary hit to that pin should be absorbed by it’s protection diodes without a problem. Is that true?

Well this approach doesn’t exactly work. The problem is I made a guess about how how the 5V rail was routed to the resistors in the the 4-resistor IC containing the 10k and was wrong, so the above disconnects the reset pull-up for the ATMega16U2, which both results in current drain over it’s reset when just the 328P is powered and like also breaks bootloader programming (at least with reset button press) and possibly even serial in general. Oops. I see a fix and will post an update later.

I think I mentioned that the 10k was a Reset pullup.

I cannot follow this discussion without some schematic. However a "protection diode" is often mentioned here. Note there is no internal protection diode on the reset pin on AVRs. Just a pull-up resistor.

I was referring to D2 on the schematic. This clamps the 10V spike that would occur when DTR (pin 13 ATmega16U2) returns high. The ATmega328P reset pin can take high voltage, but a 10V spike gets close to triggering HV programing mode.

If you've removed the bootloader and are hacking things up this much, why even keep it on the board? Just stick the chick directly in your breadboard. You can even use some cheap protoboard to make an ISP "hat" to stick over it and program it in place.

bkerin:
Well this approach doesn't exactly work. The problem is I made a guess about how how the 5V rail was routed to the resistors in the the 4-resistor IC containing the 10k and was wrong, so the above disconnects the reset pull-up for the ATMega16U2, which both results in current drain over it's reset when just the 328P is powered and like also breaks bootloader programming (at least with reset button press) and possibly even serial in general. Oops. I see a fix and will post an update later.

The correct way to do it is shown in the attachment.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.