2 Application Examples Benchmarking
All the application examples are based on the same concept with power-reducing solution increments towards the lowest power consumption scenario, using an integrated low-power module, APM. The first application example presented is not optimized for power-consumption and is used to set the base for current consumption. The second one shows how to improve the previous consumption values by using the APM to switch the analog peripherals independently on and off. The last one implements the most efficient power-saving case using Sleep mode.
The current consumption is measured with Microchip Power Debugger, and the measurements are displayed using MPLAB Data Visualizer.
Find the MCC Melody code configuration here:
The UART module sends the processed ambient temperature in degrees Celsius to the terminal every eight seconds.
The DAC module powers the MCP9700 external sensor with the lowest acceptable input (2.30V). The DAC is used instead of I/O pins because the voltage level can be precisely set, and the DAC can be switched on/off by the APM independently, without any other software necessity.
The OPA module amplifies the output voltage from the sensor to enhance the precision of the ambient temperature readings. The OPA is configured as a noninverting programmable gain amplifier with x2.67 gain. The maximum value of the input voltage for the ADC is set to 3.3V, so the maximum voltage after the OPA will also be 3.3V. This gain is chosen to amplify a specific range of ambient temperature, and the maximum output voltage from the sensor is about 1.24V, which implies a temperature range between -50 and 70 degrees Celsius. Refer to Figure 2-17: Output Voltage vs. Ambient from the MCP9700 sensor data sheet for more information. The OPA output is internally connected to the positive input of the ADC.
The ADC is configured in Single-Ended mode, with ADCRC as the necessary clock unaffected by the Sleep power-saving mode. It only needs one context, so Context 1 is configured to read the input voltage from a positive channel selection. The operating mode is Average mode, which allows the user to use the Threshold Interrupt mode. It is configured to accumulate up to eight samples then to average the value by right-shifting it with three positions without any voltage levels. A context interrupt is triggered when this value is processed in hardware and stored in the ADFLTR register.
Other configurations will be described for each scenario, because every single one presents minor differences as described above.