<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Generating audio with the DAC on MQX in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Generating-audio-with-the-DAC-on-MQX/m-p/598483#M16655</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Hi Ryan,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Yes, the best option for this is to use hardware triggering for the DAC, triggered by a hardware timer so you get the exact sampling rate.&amp;nbsp; Since you already have the DAC output working with software trigger, it won’t be difficult to setup for hardware triggering.&amp;nbsp; You need to setup a timer for the sampling rate.&amp;nbsp; Typically the PDB timer is used in Kinetis to trigger the DAC.&amp;nbsp; Then configure the DAC for hardware trigger using the DACx_C0[DACTRGSEL] bit, or DAC_TRIGER_MODE in the MQX DAC driver.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I’m not aware of an MQX example that uses the DAC in hardware trigger mode like this.&amp;nbsp; There are some MQX DAC audio appnotes written for the KwikStik board.&amp;nbsp; But these use software trigger, writing to the DAC registers in the FTM timer ISR.&amp;nbsp; There is an example in the &lt;A href="http://www.nxp.com/KSDK"&gt;Kinetis Software Development Kit (KSDK)&lt;/A&gt;, which you could use as a reference.&amp;nbsp; This is an example for the PDB driver, and is located in the driver examples folder, like \SDK_2.0\boards\frdmk64f\driver_examples\pdb\dac_trigger.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2016 14:14:14 GMT</pubDate>
    <dc:creator>dereksnell</dc:creator>
    <dc:date>2016-09-08T14:14:14Z</dc:date>
    <item>
      <title>Generating audio with the DAC on MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Generating-audio-with-the-DAC-on-MQX/m-p/598482#M16654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to generate audio with the DAC in MQX. The problem I am having is getting the sampling rate precise. I have the audio coming out, just not at the required 8192 samples/sec sampling rate. It looks to me like the "right" way to do this would be using DMA with a timer to trigger the sample but I can't find an example on how to do this? Is there an easier way to do this, knowing that I am stuck with MQX?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2016 14:16:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Generating-audio-with-the-DAC-on-MQX/m-p/598482#M16654</guid>
      <dc:creator>ryanlush</dc:creator>
      <dc:date>2016-09-07T14:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generating audio with the DAC on MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Generating-audio-with-the-DAC-on-MQX/m-p/598483#M16655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Hi Ryan,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Yes, the best option for this is to use hardware triggering for the DAC, triggered by a hardware timer so you get the exact sampling rate.&amp;nbsp; Since you already have the DAC output working with software trigger, it won’t be difficult to setup for hardware triggering.&amp;nbsp; You need to setup a timer for the sampling rate.&amp;nbsp; Typically the PDB timer is used in Kinetis to trigger the DAC.&amp;nbsp; Then configure the DAC for hardware trigger using the DACx_C0[DACTRGSEL] bit, or DAC_TRIGER_MODE in the MQX DAC driver.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;I’m not aware of an MQX example that uses the DAC in hardware trigger mode like this.&amp;nbsp; There are some MQX DAC audio appnotes written for the KwikStik board.&amp;nbsp; But these use software trigger, writing to the DAC registers in the FTM timer ISR.&amp;nbsp; There is an example in the &lt;A href="http://www.nxp.com/KSDK"&gt;Kinetis Software Development Kit (KSDK)&lt;/A&gt;, which you could use as a reference.&amp;nbsp; This is an example for the PDB driver, and is located in the driver examples folder, like \SDK_2.0\boards\frdmk64f\driver_examples\pdb\dac_trigger.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; color: #1f497d;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 14:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Generating-audio-with-the-DAC-on-MQX/m-p/598483#M16655</guid>
      <dc:creator>dereksnell</dc:creator>
      <dc:date>2016-09-08T14:14:14Z</dc:date>
    </item>
  </channel>
</rss>

