SLAAEL1 January 2025 MSPM0G3507 , MSPM0L1306
This DAC8 function generator subsystem example shows how to implement a basic function generator to output a sine wave using the integrated DAC8, a timer triggered DMA, and an OPAx module. A 256-point sine wave data table written in the code is loaded to the DAC8 about every 40μs using a timer to trigger the DMA transfers. This generates an approximate 98Hz, 256-point sine wave. The OPA is used to buffer the DAC output and route the signal to an external pin, PA22 (OPA0_Out).
Table 2-1 describes the required integrated peripherals.
Subblock Functionality | Peripheral Use | Notes |
---|---|---|
DAC8 | 1 × COMP | Shown as COMP_0_INST in
code |
DMA |
1 × DMA Channel |
Shown as DMA_CH0 in code |
Buffer | 1 × OPA | Shown as OPA_0_INST in code |
Timer | 1 × TIMG | Shown as TIMER_0_INST in
code |