Certainly the output impedance of the INA138 is way too high for the ADC and should be buffered, per the datasheet.
I don't know what exactly that output impedance number is supposed to mean. I assume it means when the output transistor of the INA138 is
not turned on, otherwise the typical application wouldn't work...
Edit: Oh silly me: the INA138 has a high output impedance because it's a current output device.
The only requirement here is that the shunt resistor to ground be much lower impedance than the ADC input, which I think we're doing just fine. The effective ADC input impedance is a function of the sampling time, and according to the STM's datasheet, the 71.5 cycle sampling time that sergey's code is using results in an effective impedance that's basically really high.
But that's not what I was talking about: I meant the signal that comes off of C75/R40 and connects to the feedback node of the DCDC via a 2.2k resistor.
The feedback network of the buck converter is kind of headscratchy to figure out in Sergey's design, since VR1 has an effect that isn't quite obvious--you'd think it changes the nominal voltage of the DC-DC, but it also changes how much that voltage is influenced by the "outer" feedback loop.
I've attached the RF board schematic for mamalala's design to this post. You can see it achieves roughly the same thing through an arguably more complex but (imo) easier to understand circuit:
- The RF feedback signal comes in as RF_DET from the peak detector. The source of this signal is very different but you can think of it as equivalent to the node between R40 and C75 in Sergey's design in that when it increases in voltage, the buck converter decreases its output voltage in response
- RF_DET is then buffered and amplified by an op-amp which adds an offset, producing VFB
- VFB feeds into the DC-DC converter's feedback node via a variable resistance.
Now that I type this out and look at the circuit, I think it's not actually quite as simple either way... but the advantage of mamalala's design, I think is that it's much easier to know what voltage range the DC-DC will operate over: Since VFB is produced by an opamp running off of +5 and 0V, its voltage can never be outside the range of 0-5V.
I think in both cases you have some feedback signal Vf (RF_DET in the mamalala case, the voltage between R40-C75 in Sergey's case) and your control is something like:
Vsupply = Vs0 - k(Vf-Vf0)
Ideally if I were designing it I'd want both Vs0 and k to be intuitively adjustable.