Low Power Application on PIC32CM LE00 Using MPLAB® Harmony v3 Peripheral Libraries: Step 7
Contents
- Build and Program the Application
- Observe Current Consumption on Data Visualizer
- Results
- Analysis
- Conclusions
Build and Program the Application
Clean and build your application by clicking on the Clean and Build button.
Program your application to the device by clicking on the Make and Program button.
Open the Tera Term application (or another terminal console) on your PC and navigate to File > New connection.
Navigate to the Serial box in the opened window and select the port number that corresponds to the Embedded Debugger (EDGB) Virtual COM Port of your connected PIC32CM LE00 Curiosity Pro. Then, press OK to open a serial connection.
Open the Serial port configuration of Tera Term by navigating to Setup > Serial port.
In the Serial Port window, verify that the baud rate is set to 115,200 and other elements are set as shown in the image, then press OK.
Now that the serial console is configured, reset the board and verify the application title message is displayed.
Cover the light sensor on the I/O Xplained Pro board by placing your hand over it (or another element to put the light sensor in a dark environment) to print the temperature and message on the terminal. You should see the following messages (containing the temperature value in °F) on the terminal every 500 milliseconds for the duration the light sensor is covered:
Observe Current Consumption on Data Visualizer
Open the Data Visualizer application from your PC and select the connected PIC32CM LE00 Curiosity Pro board on the DGI Control Panel, then click on Connect. The Data Visualizer will then start searching for protocols from the PIC32CM LE00 Curiosity Pro board through the EDBG.
Once the Data Visualizer is connected to the PIC32CM LE00 EDBG, different interfaces will appear. Select the Power interface and click on the Start button to start measuring the power consumption of the device.
The Power Analysis window will appear on the Data Visualizer tool interface.
The image shows the device in Standby mode with its measured power consumption.
Cover the light sensor on the I/O Xplained Pro board by placing your hand over it (or another element) to print the temperature on the terminal and observe the power consumption of the device. Notice 500ms RTC timer expiry when the light sensor is covered.
Press the SW1 button to switch from Standby mode to Idle mode. The following image shows the transition of the power consumption from Standby mode to Idle mode.
The following image shows the device in Idle mode with a measured power consumption of 139 µA.
Place your hand over the light sensor. The device will wake up on the next ADC window monitor interrupt, read and print data on serial and then re-enter Standby mode. The following image shows the transition of the power consumption by switching from Idle mode to Standby mode.
Results
You successfully created a low power application using the PIC32CM LE00 Curiosity Pro Evaluation Kit and I/O1 Xplained Pro Kit and experienced how, where, and which Low Power mode to use depending on the application requirements such as power and wake up response times.
Analysis
In this lab, you have successfully created a project from scratch, added Peripheral Libraries (PLIBs), and learned how to use an Event System to drive events received from the peripherals without CPU intervention. You also learned how to configure a device to work in Sleep modes and measure wake up time.
Conclusions
In this tutorial, you discovered how to configure the device to work in Sleep modes, this tutorial can be used as a reference when you develop a real-time application where the power and wake up response time plays a crucial role.