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.

PIC ADC diode protection

Status
Not open for further replies.

ptewright

New Member
Hi,

I read in the 16f877a PIC datasheet that the I/O pins have internal diode protection to limit the input voltage to +/- 0.6V from Vdd and Vss.
Does that mean that if my analog input exceeds 5V, the diode will become forward bias, and clamp it to 5V, so that the ADC will be reading 1023 (for a 10-bit resolution)?

I was actually planning on having a zener diode in parallel with my ADC input, but it seems like that would be redundant.

I can't seem to find the specs of those internal diodes. What is the max voltage that the diodes can handle. I would like to add a resistor in series with the input just to ensure that my input voltage never exceeds the max voltage that the diode can handle.
 
I seem to recall (from years ago), that the diodes are quite capable of 30-50mA? - as long as you use a 2K resistor or so to feed the ADC you will be fine. Check my tutorials for an example!.
 
Nigel Goodwin said:
I seem to recall (from years ago), that the diodes are quite capable of 30-50mA? - as long as you use a 2K resistor or so to feed the ADC you will be fine. Check my tutorials for an example!.


Attached is my circuit. Basically I'm using the ADC to read "Vout".
Vout = Iout * Rout

Rlim is there to limit the current into the ADC...I haven't quite figured out the value yet, but I want to keep the input impedance fairly low. Do you know how to calculate the input impedance of this circuit? Is it Rlim||Rout?

Also, how do I calculate the input current into the ADC?

I was wondering if it was necessary to put that external zener there since the PIC has internal protection diodes.

Thanks!
 

Attachments

  • circuit.JPG
    circuit.JPG
    5.5 KB · Views: 1,094
I want to keep the input impedance fairly low.

Actually, you want INPUT impedence to be HIGH. You want OUTPUT impedence to be LOW. A low input impedence is a very hard load to drive (imagine the current/power required to develop a 5V signal across a 1 ohm resistive load compared to a 10k resistor. You want a high input impedence so it requires less current and power. If the input impedence gets too low, the drive circuit will not be able to provide enough current to produce the voltage signal you want.

Do you know how to calculate the input impedance of this circuit? Is it Rlim||Rout?
The input resistance of any device (ie. the current sense IC) is ideally infinite so that it does not take a lot of current (or power if you will) to drive the device and can be safley approximated as such in this case. In most circuits, the output voltage in the schematic is simply drawn as the voltage between two open terminals (this is the assumption that the device you are driving has infinite resistance and therefore takes no current to drive). You can use this appromixation in most cases for IC voltage inputs (since this is the way it's designed). The conclusion is that the output impedence of the driver should be much larger than the input impedence of the load. A rule of thumb is that the output resistance of the driver should be 1/10 the input resistance of the load. I like to go with 1/100.

The input impedence is simply the resistance seen by the input terminal (to ground). If you were referring to the output resistor/diode network as the load and the IC as the driver, then the input resistance to the network is the resistance seen between the two input terminals of the network (the second terminal is ground). Assuming the zener is infinite reverse bias impedence, then the input impedence is Rlim + Rout. But you are probably going to have measurable current going through the zener. So it would be Rout + Rlim||Rzener, If you can figure out what R zener is.

Also, how do I calculate the input current into the ADC?
The input impedence to the ADC can be assumed to be ideally infinite, therefore zero current will flow, thereby causing Rlim to be the only factor in determining the current that will produce the voltage across Rlim to push the zener into breakdown (Rlim||Radc, if Radc is infinite, then Rlim dominates and Radc is neglible in this equation.).
 
Last edited:
dknguyen said:
The input impedence to the ADC can be assumed to be ideally infinite, therefore zero current will flow, thereby causing Rlim to be the only factor in determining the current that will produce the voltage across Rlim to push the zener into breakdown (Rlim||Radc, if Radc is infinite, then Rlim dominates and Radc is neglible in this equation.).

NO!! - the PIC A2D requires a MAXIMUM source impedance of around 2.5K, higher than that and you have to run it a lot slower if you switch channels, as the capacitor in the internal sample and hold requires time to charge.

My tutorial uses an opamp buffer to give a high input impedance and a low output impedance to feed the A2D, with a series resistor to the pin to limit any possible current.
 
Nigel Goodwin said:
NO!! - the PIC A2D requires a MAXIMUM source impedance of around 2.5K, higher than that and you have to run it a lot slower if you switch channels, as the capacitor in the internal sample and hold requires time to charge.

My tutorial uses an opamp buffer to give a high input impedance and a low output impedance to feed the A2D, with a series resistor to the pin to limit any possible current.

Ah, yeah that's right, touche, the successive-approximation ADC input isn't a voltage-only high-impedence input since you need some current to charge the sample-hold capacitor.

You should know though that a op-amp will add some offset error (which probably doesn't matter at all in this case because of the require accuracy and the offset is quite small).
 
Last edited:
dknguyen said:
You should know though that a op-amp will add some offset error (which probably doesn't matter at all in this case because of the require accuracy and the offset is quite small).

If it does, you just adjust it out!.
 
Status
Not open for further replies.

Latest threads

Back
Top