microcontroller optimization