element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog push a data table to MSPM0L DAC with DMA
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 May 2026 10:08 AM Date Created
  • Views 45 views
  • Likes 5 likes
  • Comments 0 comments
  • MSPM0
  • mspm0_dma
  • texas_instruments
  • dma
  • MSPM0L1306
  • texas instruments
  • ti
Related
Recommended

push a data table to MSPM0L DAC with DMA

Jan Cumps
Jan Cumps
25 May 2026
push a data table to MSPM0L DAC with DMA

The DMA engine of the MSPM0 can move data between memory locations. In this example, a table of data is DMA-moved to the data register of the onboard 8-bit DAC. The name of the example in TI resource explorer is dac8_dma_function_generator.

image

Concept

The source data for the DAC is an array of 256 samples of a sinus. One of the timers will tell DMA to copy the next value to the DAC's data register. The on-board OpAmp will buffer that data and expose it to pin 22, as an approx. 98 Hz sinus.

image

image
source: MSPM0 L-Series MCUs Hardware Development Guide

Configuration

Because the DAC is part of the comparator peripheral, that comparator 'll be the object you configure:


 image

OpAmp is configured to buffer and expose the DAC signal:

image

Timer is used to clock the move of the next sample. The 40 µs timer period drives the sinus frequency.
256 samples * 40 µs = 10240 µs -> 97.65625 Hz.

image

The MSPM0L uses an internal clock. This is not a crystal controlled frequency.

image

The DMA is then set up to transfer a table to a single destination, entry by entry (block to fixed):

image

Last check, is to see the event handling

image

Code

The bulk of the work is in the peripheral configurations. The firmware itself does a few more setup tasks, then enables DMA and timer.

Then, the controller is put in a lower power mode (_WFI). All action happens in the TIMER, DMA, COMP blocks, pushed by the EVENT. Even if you halt the CPU with a breakpoint, the design keeps on working.

/* Array of samples for function stored in flash */
const uint8_t gSineArray[SINE_ARRAY_SAMPLES] =
            {
            0x80,0x83,0x86,0x89,0x8c,0x8f,0x92,0x95,
            // ...
            0x6a,0x6d,0x70,0x73,0x76,0x79,0x7c,0x80
            };

int main(void)
{
    SYSCFG_DL_init();

    /* Configure DMA to load samples from the gSineArray to the CTL3 register of COMP_0_INST */
    DL_DMA_setSrcAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t) &gSineArray[0]);
    DL_DMA_setDestAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t) &COMP_0_INST->CTL3);
    DL_DMA_setTransferSize(DMA, DMA_CH0_CHAN_ID, SINE_ARRAY_SAMPLES);
    DL_DMA_setSubscriberChanID(DMA, DL_DMA_SUBSCRIBER_INDEX_0, 1);
    DL_DMA_enableChannel(DMA, DMA_CH0_CHAN_ID);

    /* Start the timer counting, the zero event of this timer acts as the trigger for transfer */
    DL_TimerG_startCounter(TIMER_0_INST);

    while (1) {
        __WFI();
    }
}

Most of the MSPM0 posts in this series also work on the EasyL1105 board. This one is not portable, because the MSPM0L1105 doesn't have the comparator (and OpAmp).

Related posts

DMA specific

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube