what is a microcontroller and how it works