Basically, a microcontroller is a device which integrates a number of the components of a microprocessor system onto a single microchip and optimized to interact with the…