This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

6.5. DAC

6.5.1. Overview

This example shows DAC conversions and waveform display in three working modes.

6.5.2. Board Setting

Output voltage at the specified pin. (Please refer to Pin Description

6.5.3. Running the example

  • Running log is shown in the serial terminal as follows

This is a DAC demo:
1. Direct mode
2. Step   mode
3. Buffer mode
Please enter the DAC mode code:
  • Select one of DAC working modes to start DAC conversion, and then observe the waveform through an oscilloscope

    • Direct mode

    Please enter the DAC mode code: 1
    Set DAC to output data in direct mode
    DAC is outputting a triangle waveform in direct mode
    

    • Step mode

    Please enter the DAC mode code: 2
    Set DAC to output data in step mode
    DAC is outputting a saw tooth waveform in step mode
    

    • Buffer mode

    Please enter the DAC mode code: 3
    Set DAC to output data in buffer mode
    DAC is outputting a sine waveform in buffer mode