The following configurations must be made for this project:
VREF: - Select the 2.048V internal voltage reference for the DAC peripheral - Set the Voltage Reference in Always On mode
DAC0: - Enable DAC - Enable the output buffer - Enable Run in Standby mode - Disable digital input buffer and the pull-up resistor for the DAC output external pin (PD6) ## Operation for Use Case #1 **Generating Constant Analog Signal Using 10-Bit DAC** 1. Connect the board to the PC. 2. Open the *AVR-DA128_DAC_Examples.atsln* solution in Atmel Studio 3. Set *Generating_Constant_Signal_Example* project as StartUp project:
4. Build the *Generating_Constant_Signal_Example* project: right click on *Generating_Constant_Signal_Example* and select Build
5. Select the AVR128DA48 Curiosity Nano on-board debugger in the *Tool* section of the *AVR-Dx_Bootloader* project settings:
- Right click on the project and click *Properties*;
- Click *Tool* tab on the left panel, select the corresponding debugger and save the configuration (Ctrl + S)
6. Program *Generating_Constant_Signal_Example* project to the board: select *Generating_Constant_Signal_Example* project and click *Start Without Debugging*:
**Results**
PD6 - Constant analog signal (1.2V) on Channel 0 (black) below
## Setup for Use Case #2
**Generating Sine Wave Signal Using 10-Bit DAC**
The AVR128DA48 Curiosity Nano Development Board is used as test platform.
The following configurations must be made for this project:
VREF: - Select the 2.048V internal voltage reference for the DAC peripheral - Set the Voltage Reference in Always On mode
DAC0: - Enable DAC - Enable the output buffer - Enable Run in Standby mode - Disable digital input buffer and the pull-up resistor for the DAC output external pin (PD6) ## Operation for Use Case #2 **Generating Sine Wave Signal Using 10-Bit DAC** 1. Connect the board to the PC. 2. Open the *AVR-DA128_DAC_Examples.atsln* solution in Atmel Studio 3. Set *Generating_Sine_Wave_Signal_Example* project as StartUp project:
4. Build the *Generating_Sine_Wave_Signal_Example* project: right click on *Generating_Sine_Wave_Signal_Example* and select Build
5. Select the AVR128DA48 Curiosity Nano on-board debugger in the *Tool* section of the *Generating_Sine_Wave_Signal_Example* project settings:
- Right click on the project and click *Properties*;
- Click *Tool* tab on the left panel, select the corresponding debugger and save the configuration (Ctrl + S)
6. Program *Generating_Sine_Wave_Signal_Example* project to the board: select *Generating_Sine_Wave_Signal_Example* project and click *Start Without Debugging*:
**Results**
PD6 - Sine wave on Channel 0 (black) below
## Setup for Use Case #3
**Reading the DAC Internally with the ADC**
The AVR128DA48 Curiosity Nano Development Board is used as test platform.
The following configurations must be made for this project:
VREF: - Select the 2.048V internal voltage reference for the DAC peripheral - Select the 2.048V internal voltage reference for the ADC peripheral - Set the Voltage References in Always On mode
DAC0: - Enable DAC
ADC0: - Enable ADC - Select 12-bit resolution - Select DIV2 prescaler - Set the DAC peripheral as input for the ADC ## Operation for Use Case #3 **Reading the DAC Internally with the ADC** 1. Connect the board to the PC. 2. Open the *AVR-DA128_DAC_Examples.atsln* solution in Atmel Studio 3. Set *Reading_DAC_with_ADC_Example* project as StartUp project:
4. Build the *Reading_DAC_with_ADC_Example* project: right click on *Reading_DAC_with_ADC_Example* and select Build
5. Select the AVR128DA48 Curiosity Nano on-board debugger in the *Tool* section of the *Reading_DAC_with_ADC_Example* project settings:
- Right click on the project and click *Properties*;
- Click *Tool* tab on the left panel, select the corresponding debugger and save the configuration (Ctrl + S)
6. Program *Reading_DAC_with_ADC_Example* project to the board: select *Reading_DAC_with_ADC_Example* project and click *Start Without Debugging*:
**Results**
Theoretical results for dacVal = 100
Practical results for dacVal = 100 using Debug Mode
## Setup for Use Case #4
**Generating Amplitude Modulated Signal Using 10-Bit DAC**
The AVR128DA48 Curiosity Nano Development Board is used as test platform.
The following configurations must be made for this project:
VREF: - Select the external voltage reference on VREFA pin (PD7) for the DAC peripheral - Set the Voltage Reference in Always On mode
DAC0: - Enable DAC - Enable the output buffer - Enable Run in Standby mode - Disable digital input buffer and the pull-up resistor for the DAC output external pin (PD6) |Pin | Configuration | | :----------: | :----------------: | |PD7 (VREFA) | Analog Input | ## Operation for Use Case #4 **Generating Amplitude Modulated Signal Using 10-Bit DAC** 1. Connect the board to the PC. 2. Open the *AVR-DA128_DAC_Examples.atsln* solution in Atmel Studio 3. Set *Generate_Amplitude_Modulated_Signal_Example* project as StartUp project:
4. Build the *Generate_Amplitude_Modulated_Signal_Example* project: right click on *Generate_Amplitude_Modulated_Signal_Example* and select Build
5. Select the AVR128DA48 Curiosity Nano on-board debugger in the *Tool* section of the *Generate_Amplitude_Modulated_Signal_Example* project settings:
- Right click on the project and click *Properties*;
- Click *Tool* tab on the left panel, select the corresponding debugger and save the configuration (Ctrl + S)
6. Program *Generate_Amplitude_Modulated_Signal_Example* project to the board: select *Generate_Amplitude_Modulated_Signal_Example* project and click *Start Without Debugging*:
**Results**
External Analog Signal (information signal) on VREFA (PD7) pin - Channel 1 (orange) in the screenshot below
Amplitude Modulated Signal on PD6 - Channel 2 (blue) in the screenshots below
## Summary
The [*TB3235 - Using 10-Bit DAC for Generating Analog Signals*](https://www.microchip.com/wwwappnotes/appnotes.aspx?appnote=en1001655) document provides four use cases for generating analog signals using the 10-bit DAC.