<?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: UART Tx with DMA in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266744#M8722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you enable an interrupt (DMA_DCR[EINT]) you will get one at the end of the transmitted block.&lt;/P&gt;&lt;P&gt;It is cleared with DMA_INT = (DMA_INT_INT0 &amp;lt;&amp;lt; channel_number);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end of transfer interrupt is useful because it signals that the block has been sent, can be used to control RS485 signal timing, low power activation (without moving to low power mode before a transfer has terminated) and to start a next waiting block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is the current uTasker UART code which handles interrupt/dma rx/tx operation on all UARTS/LPUART (K, KL, KE, KV, KW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.utasker.com/kinetis.html" rel="nofollow"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Low power with UARTs: &lt;/SPAN&gt;&lt;A class="jive-link-message-small" data-containerid="2019" data-containertype="14" data-objectid="421247" data-objecttype="2" href="https://community.freescale.com/message/421247#421247"&gt;https://community.freescale.com/message/421247#421247&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UARTs: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.utasker.com/docs/uTasker/uTaskerUART.PDF" rel="nofollow"&gt;http://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Nov 2015 13:52:29 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2015-11-30T13:52:29Z</dc:date>
    <item>
      <title>UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266739#M8717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm developing an application requiring uart0 tx/rx with DMA.&lt;/P&gt;&lt;P&gt;Starting from example "low_power_dma_uart_demo" I was able to configure DMA (channel0) and UART0 and the receiving was ok (I don't need Low Power mode, so I've changed some setting with respect to the given example.&lt;/P&gt;&lt;P&gt;I'm not able, at the moment, to set the trasmission with DMA. Which are the steps to do? Do I have to use a new channel (channel 1 for example) and configure it for TX? I tried but without results. &lt;/P&gt;&lt;P&gt;Some hints? Examples? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 09:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266739#M8717</guid>
      <dc:creator>ulivinico</dc:creator>
      <dc:date>2014-01-30T09:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266740#M8718</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;Tx use is equivalent to Rx use - but in the other direction. It needs a second DMA channel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When testing, monitor the DMA error register since it reports any configuration problems that stop it from working. In particular, make sure that each used DMA channel has its own unique priority since setting any two with the same (or left in uninitialised state) will lead to an immediate priority error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is setup code for UART DMA below - &lt;EM&gt;copied from the uTasker project whereby this code allows all UARTs to be operated in DMA mode if desired&lt;/EM&gt;. Not shows is the initialisation of all DMA channel priorities which is best done before any DMA has been started in the system since changing priorities during operation could cause spurious problems; if you have a chip with multiple DMA groups also ensure that the groups priorities don't conflict.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;KINETIS_DMA_TDC *ptrDMA_TCD = (KINETIS_DMA_TDC *)eDMA_DESCRIPTORS;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD += UART_DMA_TX_CHANNEL[Channel];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_SOFF = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // source increment one byte&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_DOFF = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // destination not incremented&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_ATTR = (DMA_TCD_ATTR_DSIZE_8 | DMA_TCD_ATTR_SSIZE_8); // transfer sizes always single bytes&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_DADDR = (unsigned long)&amp;amp;(uart_reg-&amp;gt;UART_D);&amp;nbsp; // destination is the UART's data register&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_NBYTES_ML = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // each request starts a single transfer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrDMA_TCD-&amp;gt;DMA_TCD_CSR = (DMA_TCD_CSR_DREQ | DMA_TCD_CSR_INTMAJOR); // stop after the defined number of service requests and interrupt on completion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;fnEnterInterrupt((irq_DMA0_ID + UART_DMA_TX_CHANNEL[Channel]), UART_DMA_TX_INT_PRIORITY[Channel], (void (*)(void))_uart_tx_dma_Interrupt[Channel]); // enter DMA interrupt handler&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uart_reg-&amp;gt;UART_C5 |= UART_C5_TDMAS;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use DMA rather than interrupts for transmission&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;POWER_UP(6, SIM_SCGC6_DMAMUX0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable DMA multiplexer 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*(unsigned char *)(DMAMUX0_BLOCK + UART_DMA_TX_CHANNEL[Channel]) = ((DMAMUX_CHCFG_SOURCE_UART0_TX + (2 * Channel)) | DMAMUX_CHCFG_ENBL); // connect UART tx to DMA channel&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uart_reg-&amp;gt;UART_C2 |= (UART_C2_TIE);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable the tx dma request (DMA not yet enabled) rather than interrupt mode&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 17:12:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266740#M8718</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-01-30T17:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266741#M8719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.nxp.com/people/ulivinico"&gt;ulivinico&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am trying to &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;develop an application requiring uart0 tx/rx with DMA. I am new in code warrior and I am using KL26Z.&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;I have found &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;low_power_dma_uart_demo example, however it is not opening. So I don't know where I should start.&lt;/SPAN&gt;&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;I would be very grateful if you could give me some hints or examples.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 18:05:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266741#M8719</guid>
      <dc:creator>cfernandes</dc:creator>
      <dc:date>2014-12-15T18:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266742#M8720</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;You can get KL26Z UART Tx DMA code from &lt;A href="http://www.utasker.com/forum/index.php?topic=1721.0" title="http://www.utasker.com/forum/index.php?topic=1721.0"&gt;http://www.utasker.com/forum/index.php?topic=1721.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 18:53:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266742#M8720</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-12-15T18:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266743#M8721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark, do I have to clear the DMA interrupt request of the specific channel once the DMA transfer is completed?&lt;/P&gt;&lt;P&gt;I get constant DMA interrupts when the CITER loop has completed..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the TRM (22.3.12 Clear Interrupt Request Register DMA_CINT), I would assume that i have to write 0x01 to clear the DMA Channel 1 interrupt?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:32:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266743#M8721</guid>
      <dc:creator>michaelguntli</dc:creator>
      <dc:date>2015-11-30T13:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266744#M8722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you enable an interrupt (DMA_DCR[EINT]) you will get one at the end of the transmitted block.&lt;/P&gt;&lt;P&gt;It is cleared with DMA_INT = (DMA_INT_INT0 &amp;lt;&amp;lt; channel_number);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end of transfer interrupt is useful because it signals that the block has been sent, can be used to control RS485 signal timing, low power activation (without moving to low power mode before a transfer has terminated) and to start a next waiting block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is the current uTasker UART code which handles interrupt/dma rx/tx operation on all UARTS/LPUART (K, KL, KE, KV, KW).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.utasker.com/kinetis.html" rel="nofollow"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Low power with UARTs: &lt;/SPAN&gt;&lt;A class="jive-link-message-small" data-containerid="2019" data-containertype="14" data-objectid="421247" data-objecttype="2" href="https://community.freescale.com/message/421247#421247"&gt;https://community.freescale.com/message/421247#421247&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UARTs: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.utasker.com/docs/uTasker/uTaskerUART.PDF" rel="nofollow"&gt;http://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:52:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266744#M8722</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-11-30T13:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: UART Tx with DMA</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266745#M8723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark, I forgot to clear the DMA_INT within the interrupt..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:03:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-Tx-with-DMA/m-p/266745#M8723</guid>
      <dc:creator>michaelguntli</dc:creator>
      <dc:date>2015-11-30T15:03:29Z</dc:date>
    </item>
  </channel>
</rss>

