# How can the value of a resistor be measured if it goes straight to ground?

I'm looking to integrate a LiPo charging circuit into my PCB, and found the MCP7831 IC. It's got a PROG pin, that allows you to change the behavior of the IC by use specific resistor values between that pin and ground.

But I'm wondering how it knows the value of the resistor?

I would think to know the value of the resistor your + voltage is applied to one side, and the other goes to an input pin of an IC that measures the lowered voltage. But if it connects straight to ground, how does the value get measured?

Have a look at the datasheet - it's shown explicitly:

In normal (not precondition) charging, a constant voltage of 1.00 volt is maintained on the PROG pin by closed loop control through the op-amps (the 1.22 V reference is divided down). The resistor connected from the PROG pin to Vss causes a current to flow of 1.00V/R. In the example, a current of 0.5mA will flow through the 2K resistor (Ohm's law).

That current is reflected in the current mirror with a 1000:1 ratio, so 500mA will flow through the battery. There's a few details beyond this, but I think this covers the question.

• Reason for the downvote? Dec 20 '14 at 21:56

It's generally done with a current source.

The current source applies a current to the unknown resistor and the voltage across the resistor is measured.

Usually the current source is will be trimmed and curvature corrected over temperature to improve accuracy.

Sometimes the voltage is measured with an ADC.

simulate this circuit – Schematic created using CircuitLab

• I'm not seeing how this maps the schematic above. Vss appears the be the IC's ground, so PROG would have to be the voltage meter? But there's no positive voltage applied trace. Is the PROG pin both V+ and the voltage meter? Dec 19 '14 at 18:45
• Prog is the top of the resistor. Vdd is internal vdd of the IC derived from Vin. Dec 19 '14 at 18:55

Like most regulator/regulation ICs that use a resistor for programming, a fixed voltage is applied to the resistor. This results in a specific current, and through either a current mirror or a current amplifier further parts of the IC can use this information to control their behavior.

The PROG pin can measure the resistor by either setting a specific voltage and measuring the current or by setting a specific current and measuring the voltage.

• So like measuring the size of the hose (resistor) by how fast the water drains from the tank (IC)? Dec 19 '14 at 18:39
• Hmm, I suppose you could think of it that way, but the analogy is a bit too lose because it suggests values that change with time. I would just say measuring the amount of water leaving the tank at any given time, the tank doesn't drain. Dec 19 '14 at 18:47