Testing the Power Modes of the Microcontroller

The power consumed in the various modes is shown here with the use of a program controlled through USART. This program prints a menu at start-up, and the user can select one of the available functions by pressing the corresponding key.

The user can choose between six functions. The first four functions set a mode to test static consumption. The last two functions are more complex. One of them cycles through the available modes and stays for four seconds in each of them. The other one simulates the long deep sleep and short wake-up operation of battery-powered sensor applications.

The application is configured with MCC in MPLAB® X and can be found in this GitHub repository.