1.7 CMP DAC Sine Wave

This code example demonstrates how to generate a 100 Hz sine wave without CPU intervention using the DMA, DAC and TMR peripherals.

Description

The DMA peripheral will utilize the timeout event generated by the TMR1 module to iterate and place values from a 256 point sine lookup table to a DAC peripheral for output.

Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file.

Path of the application within the repository is apps/cmp_dac/master/cmp_dac_sine_wave/.

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
pic32ak_gc_curiosity.XMPLABX project for Curiosity Platform Development Board and PIC32AK1216GC41064 General Purpose Dual In-Line Module (DIM)

Setting Up the Hardware

The following table shows the target hardware for the application projects.

Setting Up Curiosity Development Board

  • To run the application, following additional hardware are required:
    • Oscilloscope or probe to view the sine wave output.
  • Insert the GP DIM on to DIM slot of Curiosity Board
  • Connect the PKoB (J21) on the board to the computer using a USB type-C cable
  • Connect the oscilloscope probe to P51 (RA1/DACOUT1)