<?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>Kinetis Microcontrollers中的主题 Re: Re: How to implement a frequency counter (tachometer) with K22F</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365506#M18809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sure, but I did it long time ago, Here is the codes for reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initialization and application&lt;/P&gt;&lt;P class="ParaBody"&gt;To initialize DMA multiple pulse counting capability. We need to perform following step:&lt;/P&gt;&lt;P class="ParaBody"&gt;For DMA module:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Enable DMAMUX and DMA clock and configure DMAMUX request source.&lt;/LI&gt;&lt;LI&gt;Set DMA source and destination address to a dummy variable address.&lt;/LI&gt;&lt;LI&gt;Set DMA source and destination minor and major address adjustment and offset to zero.&lt;/LI&gt;&lt;LI&gt;Set each DMA channel’s countdown counter(CITER, BITER) to proper value;&lt;/LI&gt;&lt;LI&gt;Enable DMA channel request to wait peripheral trigger signal.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;For GPIO and PORT module:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Set PORT pin mux to GPIO&lt;/LI&gt;&lt;LI&gt;Enable DMA rising/falling request on PORT_MUX register.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;For Application:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Initializing DMA and GPIO module.&lt;/LI&gt;&lt;LI&gt;Read DMA channel counters value in application to get pulse count value.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;Reference code:&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;Uint32_t dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* clock gate initialization */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTA_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTB_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTC_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTD_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTE_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set pin to GPIO function and enable DMA request source */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* enable DMA and DMAMUX clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC7 |= SIM_SCGC7_DMA_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;Before configuring DMA MUX trigger and source number, the DMAMUX-&amp;gt;CFG[ENBL]&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;bit should be disabled. &lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* clears register for changing source and trigger */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[1] = 0; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[2] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[3] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[4] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set DMA channel request source */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[0]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(49);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[1]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(50);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[2]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(51);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[3]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[4]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(53);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Before initializing DMA register, define the source data and the address of source and destination.&lt;/P&gt;&lt;P class="ParaBody"&gt;DMA module initialization (only take DMA channel 0 for example)&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* source configuration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SADDR = &amp;amp;dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].ATTR = DMA_ATTR_SSIZE(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SOFF= 0; /* no address shift after each transfer */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SLAST = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* destination configuration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DADDR = &amp;amp;dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].ATTR = DMA_ATTR_DSIZE(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DOFF= 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DLAST_SGA= 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set CITER and BITER to maximum value */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].CITER_ELINKNO = DMA_CITER_ELINKNO_CITER_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].BITER_ELINKNO = DMA_CITER_ELINKNO_BITER_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].NBYTES_MLNO = 1; /* transfer one byte on each trigger arrived */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* enable auto close requirement */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].CSR |= DMA_CSR_DREQ_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* start transfer */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;SERQ = DMA_SERQ_SERQ(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Read DMA channel counter in your application, pulse counting value is BITER minus CITER:&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;Uint32_t value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;value = DMA0-&amp;gt;TCD[0]. BITER_ELINKNO - DMA0-&amp;gt;TCD[0].CITER_ELINKN&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Oct 2014 09:09:30 GMT</pubDate>
    <dc:creator>alex_yang</dc:creator>
    <dc:date>2014-10-31T09:09:30Z</dc:date>
    <item>
      <title>How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365500#M18803</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 trying to accurately count the frequency of a square wave input. I.e. over exactly 1 second, how many pulses were there? I'm using a FRDM-K22F board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do that I looked at using the FlexTimer module which seems to support an external clock. Unfortunately it also seems like that really was intended to be an external crystal rather than an arbitrary signal. You can only connect it to two pins and neither of those are exposed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest anything else? Ideally I'd like to do everything in hardware rather than interrupts, for accuracy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've previously used Nordic's nRF51822 and that has counters that can be driven from external inputs, and also a "Programmable Peripheral Interface" (or something) which allowed you to connect events together (e.g. so when the 1 second timer runs out it automatically stops the counter). Is there anything like that for Kenetis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 10:18:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365500#M18803</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-10-30T10:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365501#M18804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there are a few things I can suggest.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) You probably want to look at using the LPTMR instead of the FTM since the LPTMR has features designed for your use case.&amp;nbsp; It has a pulse counter option.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You could continue down the track that you are on if you are set on using the FTM.&amp;nbsp; The external inputs are designed to take in a clock (not connected to a crystal).&amp;nbsp; These are more for connection to a device like a canned oscillator. So I think it would still perform the function that you want.&amp;nbsp; You would just want to check the CNT value whenever you interrupt every second to see how many pulses came through.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If neither of these still work I do have another option up my sleeve.&amp;nbsp; Please let me know if you have any other questions.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 15:37:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365501#M18804</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2014-10-30T15:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365502#M18805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can use DMA to count &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;the frequency of a square wave input,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;DMA request is produced when the peripheral request and trigger are effective simultaneously, When DMA finish a minor loop transfer, DMA channel counter count down from the reload value until it reach zero, If we set DMA major loop counter to be the a proper value and set DMA trigger source to be external edge sensitive capture, by reading DMA channel’s countdown register, we can use any of single GPIO for pulse input capture.&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Kinetis K series includes a DMA request MUX that allows up to 64 DMA request signals to be mapped to any of the DMA channels. Thus, we can arrange PORTA-PORTE’s rising/falling trigger source to DMA channel 0-5.&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Here is my test result:&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Below picture show the result of using DMA to capture three different square waves with different frequency (10 KHz, 20 KHz and 1 KHz).&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/45980i0D9051702054F305/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/46040i74926257D4C17E57/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 01:45:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365502#M18805</guid>
      <dc:creator>alex_yang</dc:creator>
      <dc:date>2014-10-31T01:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365503#M18806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah yes, LPTMR makes much more sense and is much simpler than FTM. I was going to ask if it was possible to do it all in hardware as well, but Xi Yang has answered that already below!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 07:55:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365503#M18806</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-10-31T07:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365504#M18807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah I thought there might be something I could do with DMA. I've not really used it before though so I am a little unsure what it actually does. Anyway, very cool that this can be done just with DMA though. And thank you so much for proving that it works - I will go and read the chapter on DMA thoroughly now. :-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 07:58:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365504#M18807</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-10-31T07:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365505#M18808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PS: This is all quite new to me. I don't suppose you could post your code as you have already written it? (Much easier to learn from working examples than a reference manual!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 09:03:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365505#M18808</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-10-31T09:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365506#M18809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sure, but I did it long time ago, Here is the codes for reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initialization and application&lt;/P&gt;&lt;P class="ParaBody"&gt;To initialize DMA multiple pulse counting capability. We need to perform following step:&lt;/P&gt;&lt;P class="ParaBody"&gt;For DMA module:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Enable DMAMUX and DMA clock and configure DMAMUX request source.&lt;/LI&gt;&lt;LI&gt;Set DMA source and destination address to a dummy variable address.&lt;/LI&gt;&lt;LI&gt;Set DMA source and destination minor and major address adjustment and offset to zero.&lt;/LI&gt;&lt;LI&gt;Set each DMA channel’s countdown counter(CITER, BITER) to proper value;&lt;/LI&gt;&lt;LI&gt;Enable DMA channel request to wait peripheral trigger signal.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;For GPIO and PORT module:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Set PORT pin mux to GPIO&lt;/LI&gt;&lt;LI&gt;Enable DMA rising/falling request on PORT_MUX register.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;For Application:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Initializing DMA and GPIO module.&lt;/LI&gt;&lt;LI&gt;Read DMA channel counters value in application to get pulse count value.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="ParaBody"&gt;Reference code:&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;Uint32_t dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* clock gate initialization */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTA_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTB_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTC_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTD_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC5 |= SIM_SCGC5_PORTE_MASK,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set pin to GPIO function and enable DMA request source */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;PORTA-&amp;gt;PCR[0] |= PORT_PCR_MUX(1)| PORT_PCR_IRQC(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* enable DMA and DMAMUX clock */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;SIM-&amp;gt;SCGC7 |= SIM_SCGC7_DMA_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;Before configuring DMA MUX trigger and source number, the DMAMUX-&amp;gt;CFG[ENBL]&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;bit should be disabled. &lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* clears register for changing source and trigger */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[1] = 0; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[2] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[3] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[4] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set DMA channel request source */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[0]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(49);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[1]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(50);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[2]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(51);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[3]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(52);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMAMUX-&amp;gt;CHCFG[4]= DMA MUX_CHCFG_ENBL_MASK| DMA MUX_CHCFG_SOURCE(53);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Before initializing DMA register, define the source data and the address of source and destination.&lt;/P&gt;&lt;P class="ParaBody"&gt;DMA module initialization (only take DMA channel 0 for example)&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* source configuration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SADDR = &amp;amp;dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].ATTR = DMA_ATTR_SSIZE(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SOFF= 0; /* no address shift after each transfer */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].SLAST = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* destination configuration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DADDR = &amp;amp;dummy;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].ATTR = DMA_ATTR_DSIZE(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DOFF= 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].DLAST_SGA= 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* set CITER and BITER to maximum value */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].CITER_ELINKNO = DMA_CITER_ELINKNO_CITER_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].BITER_ELINKNO = DMA_CITER_ELINKNO_BITER_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].NBYTES_MLNO = 1; /* transfer one byte on each trigger arrived */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* enable auto close requirement */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;TCD[0].CSR |= DMA_CSR_DREQ_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;/* start transfer */&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;DMA0-&amp;gt;SERQ = DMA_SERQ_SERQ(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;&lt;/P&gt;&lt;P class="ParaBody"&gt;Read DMA channel counter in your application, pulse counting value is BITER minus CITER:&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;Uint32_t value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ParaBody" style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New';"&gt;value = DMA0-&amp;gt;TCD[0]. BITER_ELINKNO - DMA0-&amp;gt;TCD[0].CITER_ELINKN&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Oct 2014 09:09:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365506#M18809</guid>
      <dc:creator>alex_yang</dc:creator>
      <dc:date>2014-10-31T09:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365507#M18810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the code! I fixed a few typos etc. and it works as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-indent: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;uint32_t&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;dummy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;This&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;does&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;some&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;initialisation&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;stuff&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;that&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;we&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;need.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;DigitalIn&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;inputPin&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;PTC1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Set&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;selected&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;pin&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;GPIO&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;enable&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;request&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;PORT_PCR_IRQC(1)&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;means&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;rising&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;edge.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;E.g.&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;PORTC-&amp;gt;PCR[1]&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;means&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;pin&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;port&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;C&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;(which&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;SW2).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;PORTC&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;PCR&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;PORT_PCR_MUX&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;PORT_PCR_IRQC&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;blue&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;red&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Enable&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMAMUX&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;clock.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;SIM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SCGC6&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;SIM_SCGC6_DMAMUX_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;SIM&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SCGC7&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;SIM_SCGC7_DMA_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Before&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;configuring&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;MUX&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;trigger&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;number,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMAMUX-&amp;gt;CHCFG[ENBL]&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;bit&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;should&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;be&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;zeroed.&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;The&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;refers&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;channel&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;0.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMAMUX&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CHCFG&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Set&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;channel&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;request&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;49&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;port&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;A,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;50&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;port&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;B,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;etc.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMAMUX&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CHCFG&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMAMUX_CHCFG_ENBL_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMAMUX_CHCFG_SOURCE&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;51&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Before&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;initializing&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;register,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;define&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;address&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;of&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;source&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;destination.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;module&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;initialization.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Source&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;configuration&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SADDR&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;reinterpret_cast&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;lt;&lt;/SPAN&gt;uint32_t&lt;SPAN style="color: #000000;"&gt;&amp;gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;dummy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SOFF&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;No&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;address&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;shift&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;after&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;each&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;transfer&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SLAST&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Destination&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;configuration&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;DADDR&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;reinterpret_cast&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;lt;&lt;/SPAN&gt;uint32_t&lt;SPAN style="color: #000000;"&gt;&amp;gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;dummy&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;DOFF&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;DLAST_SGA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;ATTR&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_ATTR_SSIZE&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_ATTR_DSIZE&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Set&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;CITER&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;BITER&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;maximum&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;(0x7FFF).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CITER_ELINKNO&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_CITER_ELINKNO_CITER_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;BITER_ELINKNO&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_CITER_ELINKNO_CITER_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;NBYTES_MLNO&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Transfer&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;one&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;byte&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;each&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;trigger&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;arrived&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;The&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;channel's&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;ERQ&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;(enable&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;request)&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;bit&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;cleared&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;major&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;loop&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;complete.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CSR&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_CSR_DREQ_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Start&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;transfer&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;(set&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;enable&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;request).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;SERQ&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_SERQ_SERQ&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Since&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;I&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;can&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;65000&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;pulses,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;get&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;good&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;accuracy&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;at&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;low&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;speed&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;we&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;need&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;record&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;time&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;at&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;an&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;edge,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;rather&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;than&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;record&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;the&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;counts&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;at&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;a&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;time.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;To&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;that&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;we&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;just&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;interrupt&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;CITER&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;reaches&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;zero.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CSR&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;|=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA_CSR_INTMAJOR_MASK&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Enable&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;interrupt&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;NVIC.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;NVIC_SetVector(DMA0_IRQn,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;(uint32_t)DMA0_TransferCompleteIRQ);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;NVIC_EnableIRQ(DMA0_IRQn);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;//&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Read&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;DMA&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;channel&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;your&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;application,&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;pulse&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;counting&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;BITER&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;minus&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;CITER:&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(;;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE style="text-indent: 0px;"&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;uint32_t&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;BITER_ELINKNO&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;DMA0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;TCD&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;].&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;CITER_ELINKNO&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 08:13:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365507#M18810</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-11-07T08:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365508#M18811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops ignore the blue = 1; red = 0; lines - that was for debugging!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 08:14:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365508#M18811</guid>
      <dc:creator>timmmm</dc:creator>
      <dc:date>2014-11-07T08:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement a frequency counter (tachometer) with K22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365509#M18812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My setup is very similar to the example above and I have a callback timer setup with a frequency of 1 hz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As soon as my pulse input hits 33 Khz, the counting halts and will not come back until power is cycled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if there are any limitations to this implementation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2017 20:24:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-implement-a-frequency-counter-tachometer-with-K22F/m-p/365509#M18812</guid>
      <dc:creator>williamcarlisle</dc:creator>
      <dc:date>2017-12-19T20:24:58Z</dc:date>
    </item>
  </channel>
</rss>

