9.4 Data Streaming to MPLAB® Data Visualizer

In this section, the AVR DB on the Curiosity Nano will demonstrate non-inverting PGA operation, using one of its internal op amps. Hence the microcontroller is programmed with an application that:
  • Configures OPAMP0 as a non-inverting gain amplifier
  • Uses the on-chip DAC and TCB0 to generate a 50 Hz sine wave, which is fed into the positive input of OPAMP0
  • Employs the on-chip TCB1 and ADC for sampling the output of the OPAMP0
  • Data streams the ADC result and the DAC sample, via USART, to MPLAB Data Visualizer

There are no hardware requirements for this application, as all above-mentioned modules and connections are internal to the AVR DB.

To get the demo up and running, follow the steps outlined in MPLAB® Data Visualizer. The workspace-file to load is non_inverting_PGA.json, available in the GitHub repository. Figure 9-5 shows an example of the expected result.

Figure 9-5. Non-Inverting PGA - Data Visualizer Output Graph

The graph shows, in red, the DAC waveform while, in lime green, the sampled output of the OPAMP0, configured as non-inverting PGA. As expected, from the simulation step, the output signal of the amplifier has been amplified by a factor of 2, while keeping the input and output signal in phase.