6.2 Configure OP0 as a Non-Inverting PGA Using
Atmel START
Todo:
Edit the Atmel START project,
so OP0 is configured as a non-inverting PGA
Plot the input and output of OP0 in the MPLAB® Data Visualizer
Press the Reconfigure Atmel
Start Project button marked with a red circle in Figure 1 to
reconfigure the project. Figure 6-3. Assignment 4:
Reconfigure Atmel START
Press the Add software
component button, search for op amp, press the plus button and the
Add component(s) to add the op amp driver to the project.
Press the OPERATIONAL_AMPLIFIER_0 to be able to configure the OPAMP
peripheral.
Make sure the COMPONENT SETTINGS
and CLOCK is as shown in Figure 2.Figure 6-4. Assignment 4:
Component Settings
Info: The Select OPAMP combination
determines if the op amps are configured individually or combined to create
multi op amp configurations. Not every configuration is available for every
combination of op amps. See the START driver user guide for an overview. It
is also provided below.Figure 6-5. Assignment 4:
OPAMP User Guid
Make sure that OP0 is enabled by
checking the OP-AMP0 CONFIGURATION Enable. Checkmark and configure the op amp as
a non-inverting PGA by selecting Non-Inverting PGA in the Single OPAMP
Application (OP0) drop-down menu as shown in Figure 4.Figure 6-6. Assignment 4: Single
OPAMP Applications
Set the OPAMP0 SETTINGS, as shown
in Figure 5.
This will set the DAC as an input to the op amp, and the non-inverting PGA will
have a gain of 2.Figure 6-7. Assignment 4: OPAMP0
SETTINGS
Info: The grayed out options are
options that cannot change as that will break the chosen configurations, but
they are still visible to inform the user what kind of settings are needed
for the configuration.
Set the HARDWARE SETTINGS to what
is shown in Figure 6. It should be the default values. Figure 6-8. Assignment 4: Hardware
Settings
Press GENERATE PROJECT to
regenerate the start project with the newly added op amp settings.
Warning: There will pop
up a window called Project Summary shown in Figure 7.
Press okay and do not check the checkmark next to main.c. If this is done,
the project custom changes in main.c will be overwritten and lost, and the
project will not work.Figure 6-9. Assignment 4:
Project Summary
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 DAC output vs. the op
amp output using the MPLAB® Data Visualizer by loading the workspace
Assignment4.json.
Info: The DAC outputs a 50 Hz
sinusoidal wave with 128 mVpp and a DC offset of 128
mV.
Result: The
plot in the MPLAB® Data Visualizer should look similar to the one in Figure 8. The red
waveform is the output from the DAC, while the green is the output from the op amp.
As expected, the output from the op amp is two times as large as the output from the
DAC. This also matches what we saw in the simulations earlier in the assignment.Figure 6-10. Assignment 4:
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.