Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Relying on ATMEGA328 protection diodes.

Pommie

Well-Known Member
Most Helpful Member
I'm building a data logger using a Nano and an SD holder(5V converters). I need to log two 5V analog voltages and a few(5) 12V digital voltages. For the 12V inputs I'm considering just a series resistor of 10k (or maybe 22k) so the ATMEGA input will see 5.7V and ~0.6mA which exceeds the datasheet value of Vcc+0.5V.
1701931941358.png

1701932217431.png

I'm assuming that when the chip is powered down that the power LED will hold Vcc at ~2V (assuming back powered) and keep the processor in reset. I'm more worried about when it's powered as the max rating is definitely exceeded.
However, when powered down is Vcc classed as 0V? So it still exceeds Vcc+0.5V no matter what I do.
Does anyone know the forward voltage of the protection diodes (@100uA)?
Has anyone done this and what were the results.

Thanks,

Mike.
Edit, anyone know what the Vbor is for this chip? Can't find it in the datasheet.
 
Instead of a simple series resistor, use two 'highish' resistors as an attenuator, and solve your problem. It might also be a good idea to add a resistor across Vss/Vdd on the processor, if there's nothing on the Nano that's drawing enough current to pull the input down, a suitable resistor will do so.

Assuming an Atmel 328 is like a PIC (and Atmel basically copied the MicroChip philosophy), then if you feed power to an I/O pin it will power the chip via the protection diode.

The forward voltage of the diodes doesn't really matter, so it's probably not given anywhere.
 
I'd use a fairly low value external divider, eg. 1K to ground and whatever is needed to the voltage source to keep the output within the ADC range - and a shottky diode from each ADC input to the module +5V, so the maximum overvoltage is ~0.4V

The ADCs need a fairly low impedance; I'd never rely on the device internal diodes for more than a few microamps.

If the 12V inputs are logic rather than analog, still use a divider and diode, but the divider low resistor can be eg. 100K
 
I'm trying to avoid external dividers as it's a lot of soldering. I want to use a "standard" Nano board with cobbled on resistors etc. to read the values. I think 100k resistors might be the answer, no current to power the uC, I'll try it in the morning. I have found out that the BOR voltage is between 1.2 and 1.7 Volts! seems very low.

Morning will give (maybe) answers.

Mike.
 
Seems BORV can be as high as 4.5V! Or as low as 1.7V! anyone know what is used in the Arduino environment?
1701942446278.png

Mike.
Edit, where did the 1.2V come from?
 
I'm trying to avoid external dividers as it's a lot of soldering. I want to use a "standard" Nano board with cobbled on resistors etc. to read the values. I think 100k resistors might be the answer, no current to power the uC, I'll try it in the morning. I have found out that the BOR voltage is between 1.2 and 1.7 Volts! seems very low.

Morning will give (maybe) answers.

Mike.
PIC's usually have options to change the BOR, does the 328 have similar? - time to read the datasheet :D
 
Seems they do but the Arduino IDE hides that.
Mike.
There's probably a way to alter it though? - a quick google found:


I presume you need to change:

nano.menu.cpu.atmega328old.bootloader.extended_fuses=0xFD

to:

nano.menu.cpu.atmega328old.bootloader.extended_fuses=0xFC

in boards.txt, and then re-burn the bootloader.
 
Just experimented with this.
Placed a 22k resistor from 12V to D4 and connected ground.
Pin D4 measures 0.57V and Vcc (5V) measures 1V when not powered via USB.

When powered from USB the pin (D4) reads high. Vcc measures 4.5V and D4 measures 4.8V.
So, looks like a simple resistor to limit current will do.
Anyone think of any other things to check?

Mike.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top