Understand how the op amp and
DAC combine to create a power supply for VDDIO2
Edit
adc0_init() so it configures the ADC to measure
VDDIO2
Plot the measured VDDIO2
values in MPLAB® Data Visualizer
Study the
op_amp_ini() function to see how OP0 is configured as a
voltage follower with the DAC as an input.
Study the
dac_init() function to see how it outputs a constant
voltage called VDDIO2, which is defined in
dac.h.
Info: Combining the DAC and op amp
with the hardware modifications used earlier in this assignment, the op amp
will be a power supply for VDDIO2. This is illustrated in Figure 1.Figure 7-4. Assignment 5: Op
Amp as a Power Supply
In the
adc0_init() function, set VDDIO2DIV10 as an input to the
ADC by
writing:
ADC0.MUXPOS = ADC_MUXPOS_VDDIO2DIV10_gc;
Verify that the solution/project builds by selecting
the Build → Build
Solution from the top menu
bare in Atmel Studio or by pressing the
F7 key.
Flash the device by selecting the Debug → Start without
debugging
from the top menu bar in Atmel Studio or by pressing the
Ctrl+Alt+F5 keys.
Plot the measured ADC reading in the MPLAB® Data Visualizer by loading
the workspace Assignment6.json.
Result: The
ADC measurements are plotted in MPLAB® Data Visualizer, as shown in Figure 2. Note that
the unit is millivolts. Figure 7-5. Assignment 5:
Result
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.