8.4 Data Streaming to MPLAB® Data Visualizer
- Configures OPAMP0 as a voltage follower
- 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 voltage_follower.json, available in the GitHub repository. Figure 8-6 shows an example of the expected result.
The graph shows, in red, the DAC waveform, while in green, the sampled output of the OPAMP0 configured as a voltage follower. As expected from the simulation step, the two signals are overlapping in magnitude and time. The differences in signal magnitude, between the DAC generated waveform and the ADC sampled one, are due to the accumulated errors relating to the DAC, ADC and op amp (such discussion is beyond the scope of this document).