Electronic – How to 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.

enter image description here

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?

Best Answer

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

enter image description here

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.