Hi,
There are already discussions about "manipulating the FB" to adjust output voltage.
You can find all the necessary calculations there.
Just focus on voltage regulation:
Your circuit is correct: DAC, R1, R2, R3.
It seems your resistor values are correct, too.
But I recommend to make R1 value a bit smaller, because - even a rail to rail output - doesn't really go to the rails. There is always a dropout voltage. The datasheets show how much dropout voltage you can expect.
Use a standard resistor - maybe 10k - and do the fine tuning with software: A simple ADD and MULTIPLY on the DAC value will optimize the range.
Current control:
Here I doubt that your idea will work satisfactory.
A comparator switches ON or OFF.
Imagine: as long as there is no overcurrent condition, everything will work fine.
But on overcurrent condition
* the FB pin is pulled high...
* the switcher will stop to drive the output
* the output voltage drops
* the current drops
* the overcurrent condition disappears
* FB pin becomes normal
* the switcher will start to operate normally
* the output voltage will rise again
* the current will rise again
*... until the overcurrent condition will happen again
....then all starts from the beginning.
ON, OFF, with unpredictable timing, with unpredictable output voltage and current ripple...
Additionally:
* some switchers only allow a very narrow FB pin (over)voltage --> read datasheet
* you "switch" the FB pin voltage some how. This is not a usual operation of the whole feedback unit. Maybe this causes overdrive or instability within the FB circuit.
Therefore I recommend:
* either use a "regulating", analog overcurrent circuit: not switching ON/OFF. Then the FB pin voltage will still be regulated at about 0.8V, but the output voltage and the current will be reduced to the desired value.
* or use the "switching" method, but at the SHDN or ON, or OFF pin of the switcher, if there is any.
If you want the overcurrent feature fast enough to protect your load (low current overshot), then I assume the microcontroller digital loop will be too slow.
Klaus