In these two code examples, one of the integrated OPAMP(s) is used to implement a PGA for
the ADC. The microcontroller acquires a sample from the ADC while in Sleep mode.
The gain of the PGA is set by the user. Each time the button on the Curiosity Nano is
pressed, the gain is increased, up-to a maximum of 16. Once the maximum gain has been
reached, the gain is reset to 1 (unity gain).
Periodically, the microcontroller wakes up from sleep, samples the ADC, then prints the
current gain of the PGA and the measured value to a serial terminal, like MPLAB® Data
Visualizer.Figure 1-1. UART Output from Demo
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.