Microcontroller combined with state sequencer