In closed circuit voltage and current are related. You can’t change one without changing the other.

MCU can drive the input of buck converter: increase it or decrease. Then the MCU can measure the output current. If it’s lower than the programmed level the MCU increases the input and vice versa. It happens step by step dozens of thousand times per second and soon the current comes close to the programmed level.

4 Thanks