Architecture: 8051
Microcontroller: Silicon Labs C8051F850-C-GU
Toolchain: Keil c51*
The 8051 processor is a popular architecture and Keil provide a comprehensive development environment allowing for simulation and in-system debug.
The approach is to implement a feature, optimise code size as much as possible and if it fits in less than 1KB repeat. At present these features include...
- Enable UART for debug
- Enable ADC
- Enable PWM
- Control PWM duty cycle from ADC input
- Implement PID controller
- Working boost convertor
- Working buck-boost convertor
- Implement constant current mode
- Digital (UART/SPI) interface for user to control voltage/current
- Change diodes to FETs switched by the microcontroller to improve efficiency
* The compiler limits machine code generation to 2KB (not a problem) however it also limits the use of memory less than 2KB by always jumping to address 0x0800 and then continuing with compiled assembler.
BTW you can also use a SEPIC buck-boost converter - basically a boost converter with an additional capacitor and inductor.
https://en.wikipedia.org/wiki/Single-ended_primary-inductor_converter