11.4 Data Streaming to MPLAB® Data Visualizer
- Configures OPAMP0 as a voltage follower with VDD/2 input for the positive terminal
- Uses the on-chip DAC and TCB0 to generate a 25 Hz sine wave, which is fed into the positive input of OPAMP1, configured as a voltage follower
- Sets up OPAMP2 as differential amplifier were the inputs are the output from the OPAMP0 and OPAMP1 voltage followers
- Employs the on-chip TCB1 and ADC for sampling the output of the OPAMP2
- 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 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 instrumentation_amplifier.json, available in the GitHub repository. Figure 11-7 shows an example of the expected result.
The graph shows, in red, the DAC waveform while, in lime green, the sampled output of the OPAMP2, which is the same as the output of the instrumentation amplifier. As expected, from the simulation step, the output signal of the amplifier has been amplified by an order of 3 while keeping the input and output signal in phase.