<?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>Wireless MCUのトピックRe: Set Timer interrupt to control DMA get ADC data</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959510#M7769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;Hi Wi-Min Hung, I hope you're doing well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The QN908x's DMA peripheral is highly configurable and has 20 different available channels to transfer data. These channels can each have a user-configured priority and can be configured to respond to two different types of activations: either a DMA request or a trigger event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to use a timer to start a DMA transfer, you'll have to configure the channel's DMA_ITRIG_INMUX registers to select the correct trigger source:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90921i7D98BAA0BA4F3E3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the case of a CTIMERx initiated DMA transfer, the transfer will start whenever the timer's value is equal to the configured CTIMER match value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For further DMA information, you can check the DMA driver examples included with the QN908x's SDK.&lt;/P&gt;&lt;P&gt;Also, chapter 12 of the &lt;A href="https://www.nxp.com/webapp/Download?colCode=UM11023"&gt;User Manual for the QN908x&lt;/A&gt; has some additional information about the functionality of the DMA controller.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any further questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2019 20:00:51 GMT</pubDate>
    <dc:creator>Sebastian_Del_Rio</dc:creator>
    <dc:date>2019-07-10T20:00:51Z</dc:date>
    <item>
      <title>Set Timer interrupt to control DMA get ADC data</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959509#M7768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using QN9080 DK with SDK_2.x_QN908XCDK&lt;/P&gt;&lt;P&gt;I want to get ADC data by DMA controller&lt;/P&gt;&lt;P&gt;I want to set the timer for DMA that DMA will follow the timer regular transfer ADC Data&lt;/P&gt;&lt;P&gt;ex. set Timer every 4 ms use DMA to transfer ADC [ &amp;amp;DEMO_ADC_BASE-&amp;gt;DATA ]&lt;/P&gt;&lt;P&gt;Refer to the sample code of qn908xcdk_driver_examples_adc_dma&lt;/P&gt;&lt;P&gt;I found that there are some api maybe for setting DMA Transfer&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define DEMO_ADC_DMA_CHANNEL 14&lt;/P&gt;&lt;P&gt;DMA_EnableChannel(DMA0, DEMO_ADC_DMA_CHANNEL);&lt;BR /&gt; DMA_CreateHandle(&amp;amp;g_adcDmaHandle, DMA0, DEMO_ADC_DMA_CHANNEL);&lt;/P&gt;&lt;P&gt;DMA_PrepareTransfer(&amp;amp;transferConfig, (void *)&amp;amp;DEMO_ADC_BASE-&amp;gt;DATA, &amp;amp;g_AdcConvResult, sizeof(uint32_t), 4, kDMA_PeripheralToMemory, NULL);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to set the DMA for this question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:19:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959509#M7768</guid>
      <dc:creator>anniehung05911</dc:creator>
      <dc:date>2019-07-09T08:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Timer interrupt to control DMA get ADC data</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959510#M7769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;Hi Wi-Min Hung, I hope you're doing well!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The QN908x's DMA peripheral is highly configurable and has 20 different available channels to transfer data. These channels can each have a user-configured priority and can be configured to respond to two different types of activations: either a DMA request or a trigger event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to use a timer to start a DMA transfer, you'll have to configure the channel's DMA_ITRIG_INMUX registers to select the correct trigger source:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90921i7D98BAA0BA4F3E3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the case of a CTIMERx initiated DMA transfer, the transfer will start whenever the timer's value is equal to the configured CTIMER match value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For further DMA information, you can check the DMA driver examples included with the QN908x's SDK.&lt;/P&gt;&lt;P&gt;Also, chapter 12 of the &lt;A href="https://www.nxp.com/webapp/Download?colCode=UM11023"&gt;User Manual for the QN908x&lt;/A&gt; has some additional information about the functionality of the DMA controller.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any further questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 20:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959510#M7769</guid>
      <dc:creator>Sebastian_Del_Rio</dc:creator>
      <dc:date>2019-07-10T20:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set Timer interrupt to control DMA get ADC data</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959511#M7770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I configue DMA_ITRIG_INMUX by adding the following code in main function,&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;INPUTMUX-&amp;gt;DMA_ITRIG_INMUX[4];&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;Q :&lt;/STRONG&gt; Is it&amp;nbsp;mean I selet DMA trigger #4 &amp;gt;&amp;gt; timer CTIMER0 Match 0 DMA request ?&lt;/P&gt;&lt;P&gt;By Setting CTIMER, I refer the sample code - ctimer_simple_match&lt;/P&gt;&lt;P&gt;1. Include the fsl_ctimer.h library,&lt;/P&gt;&lt;P&gt;2. Add the following code in main function, &amp;gt;&amp;gt; &lt;SPAN style="color: #0000ff;"&gt;But it didn't trigger DMA&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define CTIMER CTIMER0 /* Timer 0 */&lt;BR /&gt;#define CTIMER_MAT_OUT kCTIMER_Match_2 /* Match output 2 */&lt;BR /&gt;#define BUS_CLK_FREQ CLOCK_GetFreq(kCLOCK_ApbClk)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;in Main function&amp;gt;&lt;/P&gt;&lt;P&gt;ctimer_config_t config;&lt;BR /&gt; ctimer_match_config_t matchConfig;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CTIMER_GetDefaultConfig(&amp;amp;config);&lt;BR /&gt; CTIMER_Init(CTIMER, &amp;amp;config);&lt;BR /&gt; matchConfig.enableCounterReset = true;&lt;BR /&gt; matchConfig.enableCounterStop = false;&lt;BR /&gt; matchConfig.matchValue = BUS_CLK_FREQ / 2;&lt;BR /&gt; matchConfig.outControl = kCTIMER_Output_Toggle;&lt;BR /&gt; matchConfig.outPinInitState = true;&lt;BR /&gt; matchConfig.enableInterrupt = false;&lt;BR /&gt; CTIMER_SetupMatch(CTIMER, CTIMER_MAT_OUT, &amp;amp;matchConfig);&lt;BR /&gt; CTIMER_StartTimer(CTIMER);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;STRONG&gt;Q :&amp;nbsp;&lt;/STRONG&gt;How to configure the CTIMER, that I can use CTIMER to trigger DMA ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;STRONG&gt;Q :&lt;/STRONG&gt; And problem for CTIMER, what is the different between Match 0 and Match 1?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 15:24:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959511#M7770</guid>
      <dc:creator>anniehung05911</dc:creator>
      <dc:date>2019-07-18T15:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Timer interrupt to control DMA get ADC data</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959512#M7771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wei-Min Hung,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL type="1"&gt;&lt;LI&gt;Each of the Standard Counting Timers included in the QN9080 has 4 different match registers, each with a different configurable value, depending on the selected match configuration, the DAM transfer will activate either on the match 0 or match 1 values.&lt;/LI&gt;&lt;LI&gt;The configuration of the timer for this purpose involves changing the value for the corresponding match register, so that when the TC matches the register, it generates an interrupt or a DMA transfer. You'll have to change the MCR register to allow the transfer to the desired match register.&lt;/LI&gt;&lt;LI&gt;Each of the internal CTIMERs has different MATCH registers, and for DMA transfer, you can use either 0 or 1 of each of the CTIMERs.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For further reference, you can read sections 12 (DMA transfer) and 14 (CTIMER 0 to 3) of the QN908x User Manual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also check some of the examples included in the QN9080 SDK, specifically the CTIMER Simple Match and Simple Match Interrupt examples for reference on correct CTIMER configuration. ("…\SDK_2.2.0_QN908XCDK\boards\qn908xcdk\driver_examples\ctimer").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 16:21:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Set-Timer-interrupt-to-control-DMA-get-ADC-data/m-p/959512#M7771</guid>
      <dc:creator>Sebastian_Del_Rio</dc:creator>
      <dc:date>2019-07-22T16:21:41Z</dc:date>
    </item>
  </channel>
</rss>

