These links ([1, ](Sprites mods - Run an uC from an AA-battery - Introduction, ucboost)2 ) show a very basic implementation of a switched mode voltage controller using the microcontroller it powers to also drive the circuit. The 2nd link also implements voltage regulation using an ADC pin to control the PWM pin driving the circuit.