Function of the Circuit: • Provide a constant voltage of 3.7V at the load for battery charging when there is an input ranging from 0V to 5V. • When SW1 driven by PWM 1 and SW2 is always OFF, the device will work in Buck Mode. That is if input voltage goes above 3.7V. • When SW1 is always ON and SW2 is driven by PWM 2, the device will work in Boost Mode. That is if input voltage is below 3.7V. Question: How to create a feedback system at the output which will cause the output to stay constant at 3.7V? • The circuit have to boost the voltage to 3.7V if the voltage at the input is below 3.7 V • The circuit have to buck the voltage to 3.7V if the voltage at the input is above 3.7V Note: The circuit is attached in the thread.