<?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: Questions about DMA controller on Kinetis L Series in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283201#M10679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the "SSIZE" and "DSIZE"&amp;nbsp; although are the auto-align basis , it still really for the data size of the source and destination&amp;nbsp; bus cycle for the DMA controller.&lt;/P&gt;&lt;P&gt;If both equal or disable auto-align (sw trigger DMA),&amp;nbsp;&amp;nbsp; there isn't&amp;nbsp; auto-align.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Sep 2014 12:23:52 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2014-09-29T12:23:52Z</dc:date>
    <item>
      <title>Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283194#M10672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Hi, I have two questions about the DMA engine on the &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL2x"&gt;KL25&lt;/A&gt; — I'm hoping someone can help:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I would like to perform transfers from an array containing bytes to a peripheral register (TPM1_C0V). I thought this is exactly what SSIZE and DSIZE are for, so I set SSIZE to 8 bits and DSIZE to 32 bits:&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;DMA_DCR0 = DMA_DCR_EINT_MASK | DMA_DCR_ERQ_MASK | DMA_DCR_CS_MASK | DMA_DCR_SSIZE(0b01) | DMA_DCR_SINC_MASK | DMA_DCR_DSIZE(0x00);&lt;/P&gt;

&lt;/BLOCKQUOTE&gt;&lt;P&gt;I expected to be able to access single bytes from the source array, get them 0-padded to 32 bits by the DMA engine and get 32-bit writes to the target register. But what I actually get are 32-bit reads and 32-bit writes, e.g. on the first DMA request 4 bytes are copied from source to destination instead of one. The timer then truncates the write to 16-bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've read and re-read the DMA section in the reference manual dozens of times and I can't see how this could be the intended behavior. If it is the expected behavior, how do I convert from source bytes to word writes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I tried to implement a DMA ping-pong scheme, which proved unexpectedly hard. There is no half-way interrupt on the L series DMA engine. I wanted to use the other DMA channels in linked mode, to reconfigure things so that channels are switched. But then I found out that DMAMUX documentation says "Setting multiple CHCFG registers with the same Source value will result in unpredictable behavior". That is exactly what I need to do: I have one peripheral issuing requests, and wanted to have two channels, only one of which would have the ERQ bit set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having read that, I then tried to use *two* DMA channels for DMAMUX configuration changes. So the procedure would be roughly:&lt;/P&gt;&lt;P&gt;* DMA0 runs, upon completion links to DMA3,&lt;/P&gt;&lt;P&gt;* DMA3 writes a 0 to DMAMUX channel 0 and links to DMA4,&lt;/P&gt;&lt;P&gt;* DMA4 enables DMAMUX channel 1 with the appropriate source.&lt;/P&gt;&lt;P&gt;* DMA1 runs, upon completion links to DMA3 (which has hopefully been reconfigured in the meantime).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this and it works. But I am still unclear on how the DMAMUX registers need to be accessed. Do I need to separately write the source, and then the enable bit, or is just a single write enough? Similarly for switching off: is a single 0-write enough?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'm wondering about the "unpredictable behavior" mentioned above. Is that really the case when only one of the channels is enabled for peripheral requests?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More generally, is there something I'm missing? A better way to have a ping-pong DMA scheme where one buffer can be prepared while the other gets sent?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Nov 2013 11:57:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283194#M10672</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2013-11-17T11:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283195#M10673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;To your first question, I suggest that you can referece LQRUG_tpm_ex2 in the FRDMKL25 demo code which you through the link as below shows to download.&lt;/P&gt;&lt;P&gt;About your sceond question, I think if you can gurantere that only one of the channels is enabled for particular peripheral request then it will not cause unpredictable behavior.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;P&gt;KL25_SC.exe:&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 05:00:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283195#M10673</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-18T05:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283196#M10674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the example. But if I understand it correctly, it issues 16-bit to 16-bit requests (SSIZE=DSIZE=0x02) from a circular buffer of 64 16-bit values. What I was trying to do was read 8-bit values and store them to a 32-bit register (I see now that it can also take 16-bit values). Is this possible with DMA? If not, what are the SSIZE/DSIZE settings really for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case the problem is that I need to load the values very quickly (not later than every 1.3µs, that's 26 cycles at 20MHz!), and cannot afford to waste memory, I have to generate data on the fly. Every bit of input data requires a timer write, so even for 1kB of data expanding every bit to 16-bits is not manageable. An 8-bit buffer would be OK if I could use a ping-pong scheme.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 11:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283196#M10674</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2013-11-18T11:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283197#M10675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;Hi Jan,&lt;/P&gt;&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;It's ok that the size of source and destination is different. And you will know how to configure the register of DMA after you go throuh the 23.4.4 Advanced Data Transfer Controls: Auto-Alignment in the &lt;A href="http://cache.freescale.com/files/32bit/doc/data_sheet/KL25P80M48SF0.pdf"&gt;KL25's datasheet&lt;/A&gt;.&lt;/P&gt;&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;For you problem, How do you think the method that increase the frequency of system clock to reduce the time cost?&lt;/P&gt;&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;Best regards,&lt;/P&gt;&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;Ping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 10:06:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283197#M10675</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2013-11-19T10:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283198#M10676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;Ping Zhou wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="margin: 5px 0px; color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"&gt;It's ok that the size of source and destination is different. And you will know how to configure the register of DMA after you go throuh the 23.4.4 Advanced Data Transfer Controls: Auto-Alignment in the KL25's datasheet.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;Quoting from section 23.4.4: &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Typically, auto-alignment for DMA transfers applies for transfers of large blocks of data. As a result, it does not apply for peripheral-initiated cycle-steal transfers." &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Well, in my case what I do is peripheral-initiated cycle-steal transfers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading from page 358: "If auto-alignment is enabled, the appropriate address register increments, regardless of DINC or SINC". &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In my case DINC is false, the destination is a fixed TPM peripheral register.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I understand about auto-alignment, it is used to optimize transfer sizes. Are you sure it is relevant in my case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question #1 was about doing this procedure with DMA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) read a byte from memory&lt;/P&gt;&lt;P&gt;2) zero-extend that byte to 32-bits (a word)&lt;/P&gt;&lt;P&gt;3) write the word to the TPM peripheral C0V register, which only accepts word writes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the combination of flags that I used was exactly for this purpose, but it seems I am wrong. Is it possible to perform the procedure above using DMA?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to clock frequency, yes, of course I will increase it, but it will not help with peripheral access times and I don't know how much it helps with interrupt latency.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 14:03:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283198#M10676</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2013-11-19T14:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283199#M10677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct. Auto-Align does not apply to &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;peripheral-initiated cycle-steal transfers.&lt;/SPAN&gt; A potential solution to your problem would be 16-bit SSIZE &amp;amp; DSIZE. The TPM0_CnV registers will take a 16-bit write. You could pad the first byte of each buffer entry with zeros, and write the 16-bit value to the C0V register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this solution works for you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 22:49:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283199#M10677</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-11-19T22:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283200#M10678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might work, but it is wasteful — it means I have to prepare twice as much DMA data. I'm not sure I'll have enough time to do that. And I definitely need the ping-pong scheme to work, then, as there is no way I will be able to store my entire data in RAM (with a single bit expanding into two bytes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still curious: what is SSIZE really for? If it's about alignment only, shouldn't it be called SALIGN?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:29:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283200#M10678</guid>
      <dc:creator>jrychter</dc:creator>
      <dc:date>2013-11-25T16:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Questions about DMA controller on Kinetis L Series</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283201#M10679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the "SSIZE" and "DSIZE"&amp;nbsp; although are the auto-align basis , it still really for the data size of the source and destination&amp;nbsp; bus cycle for the DMA controller.&lt;/P&gt;&lt;P&gt;If both equal or disable auto-align (sw trigger DMA),&amp;nbsp;&amp;nbsp; there isn't&amp;nbsp; auto-align.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 12:23:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Questions-about-DMA-controller-on-Kinetis-L-Series/m-p/283201#M10679</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2014-09-29T12:23:52Z</dc:date>
    </item>
  </channel>
</rss>

