Hey dom0,
Ah yes, my bad, I forgot to check that. The ADC says -0.3 to 6.5V for any digital pin, so I'm OK there. However, the DAC says -0.3 to (Vdd + 0.3), so that's a problem. Vcc is actually not 0V, as I was measuring ~3V since the rails were being powered by the internal clamping diodes. However, the digital I/O is at 5V, so that still exceeds the maximum ratings.
I bet if you measured those digital I/O pins, they wouldn't be at 5v, they'd be one diode drop above 3v.
Regardless, as mentioned you shouldn't use the clamping diodes on purpose, tri-stating the SPI lines until the 24v supply is detected is a good idea.
I recall measuring these pins last night and they were 5V. I'll check again tonight.
You could also keep the Arduino in reset while the 24 V supply isn't there, or power it from the 24 V, too.
I will also consider the reset, that way I won't have to add more firmware scenarios. Also, I need to have the USB plugged in for serial communication, so regardless of how I look at it, there will always be a scenario where the user can plug the USB in first before turning on the 24V supply, thus powering up the Arduino via the USB.
Hey dom0,
Ah yes, my bad, I forgot to check that. The ADC says -0.3 to 6.5V for any digital pin, so I'm OK there. However, the DAC says -0.3 to (Vdd + 0.3), so that's a problem. Vcc is actually not 0V, as I was measuring ~3V since the rails were being powered by the internal clamping diodes. However, the digital I/O is at 5V, so that still exceeds the maximum ratings.
The thing to watch out for is the current through the diodes. The specified voltages just tell you at what point the diodes start to conduct, you won't damage the diodes until the current gets to an appreciable level. In your case, the current through the diodes will be determined by the load on the rails they're supplying and the current source capabilities of the Arduino's SPI drivers. On a related note, I just ran across an Atmel app note that uses a 1M series resistor into a GPIO to detect mains zero crossing, relying on the clamping diodes to limit the voltage at the IO pin. It's all about limiting the current. Not many datasheets specify a maximum forward current for the diodes, though (IIRC, Atmel's datasheets usually do), so best to not push your luck.
Aside from damaging the diodes, some devices may experience latchup or other problems when the inputs approach or exceed the supply rails, but that's more common in analog parts than digital. I'd be a bit more concerned about the ADR02 in this respect, since you're using it to power the DAC you're driving it's output when the 24V supply is disconnect. The Arduino probably can't source enough current to cause a problem there (or the ADR02 might not have any problem being driven that way, I haven;t looked at the datasheet), but best to avoid it if you can.
Any time you have multiple sources and/or multiple rails it's worth taking a look at what happens if the supplies come up in the wrong order, or one rail fails to start entirely, etc. Usually in such cases the system will just fail to work, but in some cases you can wind up with very different voltages than you intended appearing at different parts of the circuit, potentially causing sudden magic smoke release.
Thanks for the in depth explanation, makes sense. I also worried about driving the output of the ADR02, although I couldn't find any information in the datasheet that specified whether this was OK or not (if someone finds something in there, please let me know, I may have missed it).
Yes, having to consider the order of the supplies is something I totally overlooked when initially designing this. I'll know better next time!
While Analog doesn't supply an equivalent schematic for the ADRxx it's probably the usual thing of bandgap reference + trimmed divider + error amplifier + series pass element. Assuming a bipolar process, so reverse voltage there isn't an issue if smaller than about 6 V.
Atmel doesn't specify permissible current through the ESD diodes, but in the app note you brought up I think they say something like "well, uh, we don't specify this, but if you limit the current to less than a milli-amp it's okay to use them for clamping".
But of course: none of this is specified. In fact, Analog doesn't say a single word about external voltages applied to Vout while Vin is down. So it's hopefully clear that one should not rely on any of this :-)
Yes, I'll just stay on the safe side =)
ADR02 is a REFERENCE supply, not a voltage regulator to power downstream circuits.
POWERING ADC and DAC circuits from the ADR02 just seems bizzare.
Google never heard of: "ADC1215021"
Sorry if my writing wasn't clear enough, the part # is "ADC121S021"
If you look at the datasheet for the DAC I chose, it actually suggests using the voltage reference I've picked as a supply:
http://www.farnell.com/datasheets/1780742.pdf. I also made sure that the current output of the reference was able to supply current to both the ADC/DAC based on their consumption.