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
  1. 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
  2. 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.
  3. Press the OPERATIONAL_AMPLIFIER_0 to be able to configure the OPAMP peripheral.
  4. 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
  5. 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
  6. 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.
  7. Set the HARDWARE SETTINGS to what is shown in Figure   6. It should be the default values.
    Figure 6-8. Assignment 4: Hardware Settings
  8. 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
  9. Verify that the solution/project builds by selecting the BuildBuild Solution from the top menu bare in Atmel Studio or by pressing the F7 key.
  10. Flash the device by selecting the DebugStart without debugging from the top menu bar in Atmel Studio or by pressing the Ctrl+Alt+F5 keys.
  11. 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