10.4 Data Streaming to MPLAB® Data Visualizer
- Configures OPAMP0 and OPAMP1 to create a differential amplifier configuration
- The positive input of OPAMP0 is connected to VDD/2
- Uses the on-chip DAC and TCB0 to generate a 25 Hz sine wave, which is fed into the positive input of OPAMP1
- Employs the on-chip TCB1 and ADC for sampling the differential signal between the DAC and the output from OPAMP1
- Data streams the ADC result, and the DAC sample subtracted from VDD /2, via USART, to MPLAB Data Visualizer
There are no hardware requirements for this application as all the 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 differential_amplifier.json, available in the GitHub repository. Figure 10-6 shows an example of the expected result.
The graph in Figure 10-6 shows in red the DAC waveform relative to VDD/2, while the lime green is the sampled output of the OPAMP1 relative to the DAC output. As expected, from the simulation step, the lime green waveform has an amplitude that is approximately three times larger than the input waveform. The reason the amplitude of the light green waveform is not exactly three times as large as the red one is due to the accumulated errors relating to the DAC, ADC and OPAMP (such discussion is beyond the scope of this document).