4
\$\begingroup\$

I'm using a PIC18F MCU.

I am using an ADC reference of 3.3 V. If I want to measure 4 V, what would happen? Would the internal ADC peripheral get damaged or will the ADC work fine, and show the maximum value?

It is mentioned one should not apply more than 300 mV outside the supply rails. If the ADC input got more than the supply rail, then what would the PIC controller behavior be?

Also, the clamp current is mentioned as 20 mA which must be distributed across all the I/O pins. What if I provide a clamping current of 20 mA to each pin? The internal diodes would get stressed and lead to failure? I assume the internal pins have only diodes and not resistors. I couldn't find any info on the internal clamping diodes and resistors in the datasheet.

\$\endgroup\$
2
  • \$\begingroup\$ What kind of answer do you expect? Why do you want to operate the MCU outside its specification? \$\endgroup\$ Feb 28, 2023 at 7:09
  • \$\begingroup\$ @thebusybee, I am just curious to understand what would happen in those cases? I do not want to operate in those conditions. Just understanding what would be the effects. \$\endgroup\$
    – user220456
    Feb 28, 2023 at 7:12

2 Answers 2

4
\$\begingroup\$

I am using an ADC reference of 3.3 V. If I want to measure 4 V, what would happen? Would the internal ADC peripheral get damaged or will the ADC work fine, and show the maximum value?

You need to check the Electrical Specifications in chapter 39:

enter image description here

enter image description here

Source: PIC18F26/45/46Q10 Datasheet

So it all depends what VDD is in your case. It could be anywhere between 1.8..5.5 V (Table 39-1) under operating conditions.

So if VDD is below 3.7 V you might damage your device. I would also treat any VDD below 4.0 V as if it were below the absolute max value, because it's a grey area.

And if it's at 4.0 V or above the ADC value would simply clip at the max value.

As @MattS commented, you always have to meet the specifications of -0.3 V to (VDD + 0.3 V). So if your device is unpowered (i.e. VDD = 0 V), VPIN mustn't exceed +0.3 V.

Another input by @TimWilliams:

One more note -- in the process of injecting current, the pin voltage may rise above VDD+0.3V. The current and voltage limits shall be understood inclusively, i.e. voltages higher than this are acceptable (again, for survival purposes) if the current limits are respected.

Here is a discussion on the Microchip forums that supports this assertion: PIC16LF18324 ADC input higher than Vref+


Also, the clamp current is mentioned as 20 mA which must be distributed across all the I/O pins. What if I provide a clamping current of 20 mA to each pin? The internal diodes would get stressed and lead to failure? I assume the internal pins have only diodes and not resistors. I couldn't find any info on the internal clamping diodes and resistors in the datasheet.

You find this answer also in the same table in chapter 39.1 Absolute Maximum Ratings:

enter image description here

enter image description here

If you apply a clamp current of ±20 mA to each pin, you'll definitely fry your MCU. You must also meet the specifications for maximum current and total power dissipation, which you'll exceed.

This question may also add some further insights: What is meant by Input clamp current/Output Clamp current in micro controller datasheet?

\$\endgroup\$
10
  • \$\begingroup\$ Thank you for your answer. So, If I apply 4V at the ADC input when the ADC reference is 3.3V, I won't be damaging the chip? The value will be the maximum value only? \$\endgroup\$
    – user220456
    Feb 28, 2023 at 7:45
  • \$\begingroup\$ Yes, as long as VDD is 4V or above. Otherwise the datasheet would be inaccurate. \$\endgroup\$
    – Velvet
    Feb 28, 2023 at 7:47
  • 1
    \$\begingroup\$ "So it all depends what VDD is in your case. It could be anywhere between 1.8..5.5 V." Minor quibble: VDD can also be 0 V when your power is off. Applying a voltage that is in-range when the chip is powered may have unpredictable effects if you apply it when the chip is off. \$\endgroup\$
    – Matt S
    Feb 28, 2023 at 9:23
  • 1
    \$\begingroup\$ @MattS Good point, I didn't think about the obvious, I'll update my answer. \$\endgroup\$
    – Velvet
    Feb 28, 2023 at 9:25
  • 2
    \$\begingroup\$ One more note -- in the process of injecting current, the pin voltage may rise above VDD+0.3V. The current and voltage limits shall be understood inclusively, i.e. voltages higher than this are acceptable (again, for survival purposes) if the current limits are respected. \$\endgroup\$ Feb 28, 2023 at 9:28
2
\$\begingroup\$

Regarding the effect:

Analog pins are generally sensitive to injected current. Whether that's true of the PIC18 family and ADC, who knows. It's not clear from the datasheet whether this is the case. Many other devices suggest zero injection while analog functions are in use on respective pins / IO banks.

Simply, the most likely result is ADC readings out of tolerance. Maybe it'll still read 0x03ff anyway, maybe it'll be marginal (erroneous at min clock, max. temp., etc.), maybe it reads zeroes or gibberish.

It's not likely to cause CMOS latchup if the current limit is respected in the process, but supplying a hard-fixed (excess) voltage to a pin is likely to cause much more current flow. Typically ~100mA is required to induce latchup.

See: Quality Handbook - Microchip It appears they rate their products to 200mA, even; though the exact nature of those tests isn't given and you'd have to find the underlying standard to see.

Contact the manufacturer for more information.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.