I do not understand the first paragraph of your answer. Because in LM385-Z-2.5 datasheet, page 19, figure 16, they is no formula to use and any resistor to calculate. Just one 200 K resistor.
Figure 16 gives two additional informations:
* Micropower .... and means here the low current limit of operation
* supplied by 9V
* there is no load (current)
At the very beginning of the datasheet ... page #1 it says: "Operating Current of 20 μA to 20 mA"
But indeed if you look for operating conditions you should use the according datasheet section: "ELECTRICAL CHARACTERISTICS"
--> Minimum Operating Current --> Design Limit: 20 μA
You, as the designer, need to follow these rules for correct and reliable operation. Also all the oter specifications, they are listed for a reason.
I´m no friend of designing at the very limit ... because if something unexpected happens ... you risk to leave the safe operation area.
But for you .... leat´s try to go to this limit:
Thus we use the specified 20uA as the LM385 lower limit.
Now we want to calculate the resistor:
For this ... according Ohm´s law we need to know two values:
* the expected voltage across the resistor
* the expected current through this resistor
-> Voltage: the worst case is: when the supply voltage is at minimum, and when LM385 voltage is at maximum.
A 5V supply surely does not perfectly 5.000V all them time. According power supply input, load current, device type, temperature drift.... you should expect it to be less.
How low.... I can only guess, because I don´t have any information about your circuit regarding this. Thus I assume it to be 5% below nominal --> 4.75V
The maximum LM385 voltage is 2.530V (this is the 100uA current... to be on the sae side)
-> Current: Here you need to understand that the resistor current needs not only to supply the LM385 ... but also the load. In your case the PIC´s REFerence input.
To go to the limit ... you need to use the MAXimum current to be drawn (by all loads. I don´t know if anything else than the PIC is connected).
I don´t take the effort now to read the PIC datasheet ... thus I use a guessed number of 10uA max (over device, aging, temperature....)
-> Now it´s time to use the most basic formula in electronics: Ohm´s law:
R = V / I
-> R_max = (V_min / I_max) = (4.75V - 2.53V) / (20uA + 10uA) = 2.22V / 30uA = 74kOhm.
We are not finished yet .. because if you buy a resistor ... it comes with tolerance. Let´s say you use a +/-1% tolerated one (over part, time, temperature..)
Thus you must not use a real resistor with less than 74kOhm / (1 +1%) = 74k / 1.01 = 73.27 kOhms max (nominal value)
--> use a resistor with less than 73.27 kOhms
This is the very limit for save operation.
(Now it´s time to recognize that 200k is far too high for safe operation)
***
My way:
--> I usually calculate with a supply voltage to be 10% less than nominal (mind this value should cover even small negative spikes in the microseconds)
This is 4.5V.
Also one has to consider additional load currents like stray currents in PCB and capacitors.
For the LM385 I either use values used for specification. In this case
* I see they use 100uA for testing their behaviour.
* Another approach is to use half of them max value: = 20mA/ 2 = 10mA
* Another way is to use the square root of (min_current * max_current) = sqrt ( 20uA * 20mA) = sqrt(400nA^2) = 630uA
Which method you use is your choice. (You would go for higher current if you have unknown conditions like voltage and load current, you would go for lower current if you are battery operated or you want to keep self heating of total application low)
What´s the idea behind the "square root" method?
--> it gives you the same "safety factor" to lower and to upper limit.
This means: the factor to lower limit is 630uA / 20uA = 31.5
the factor to upper limit is 20mA / 630uA = 31.7
A factor of 31 is huge btw. You usually would use tis method when the two limits are rather close to each other. Example: when given "100uA min to 200uA max."
****
I mentioned capacitors.. Yes, this is a REFerence node. It should be kept low noise. I probably would add a 1uF ceramics capacitor close at the PIC.
For the calculations above ... maybe Excel is useful. Then you can can input your application parameters ...
and it automatically calculates
* min resistor, and the according current, power dissipation in REF and resistor
* max resistor, and ....
* and what else you are interested in
You may use the same excel file to calculate current limiting resistors for optocoupler, LEDs, zeners.... and so on
Klaus