<?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: Timer trigered DMA transfer in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520455#M3650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Wed Mar 26 03:41:51 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I write here, becouse I already read the UM and can't figure out how it work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just have one question. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How DMAREQSEL and Destination Request Peripheral of an specific chanel are related one each other?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to configure DMA, TIMER1 and SPI to send data (I'm using MOSI output only, not use SCKL, SSEL and MISO on my application) when Match Register 0 match Timer1 TC ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, I test code configuring DMAREQSEL with MAT1.0 and Chanel 0 Destination Request Peripheral with SPI. But this doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:44:39 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:44:39Z</dc:date>
    <item>
      <title>Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520449#M3644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Tue Mar 18 17:22:08 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, I'm testing DMA on LPC1769. I need to transfer some bytes out using SSP0 as SPI. I want to do this every timer1 MR0 match Timer1 TC. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I write this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
#ifdef __USE_CMSIS
#include "LPC17xx.h"
#endif

char data[25]={1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5};

#include &amp;lt;cr_section_macros.h&amp;gt;
#include &amp;lt;NXP/crp.h&amp;gt;

void SSP0Init();

/*******************************************************************************
**&amp;nbsp;&amp;nbsp; Main Function&amp;nbsp; main()
*******************************************************************************/
int main (void){

SSP0Init();// Inicializo el bus SPI

// setup timer1
LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 2; // Power up
LPC_SC-&amp;gt;PCLKSEL0 |= 0x01 &amp;lt;&amp;lt; 4; // CCLK -&amp;gt; 10nseg ticks
LPC_TIM1-&amp;gt;MR0 = 2000;// Match a los 20 useg
LPC_TIM1-&amp;gt;MCR = 1 &amp;lt;&amp;lt; 1; // reset on Match Compare 0

LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 29; // Power up DMA

LPC_GPDMACH0-&amp;gt;DMACCConfig = 0; // stop ch0 dma

LPC_GPDMA-&amp;gt;DMACConfig |= 1 &amp;lt;&amp;lt; 0; // enable DMA
//LPC_GPDMA-&amp;gt;DMACSync |= 1 &amp;lt;&amp;lt; 10; // use MAT1.0 for Sync
LPC_SC-&amp;gt;DMAREQSEL |= 1 &amp;lt;&amp;lt; 2; // Timer1 Match Compare 0 as DMA request

LPC_GPDMA-&amp;gt;DMACIntErrClr |= 0xff;
LPC_GPDMA-&amp;gt;DMACIntTCClear |= 0xff;

LPC_GPDMACH0-&amp;gt;DMACCDestAddr = (uint32_t) &amp;amp;(LPC_SSP0-&amp;gt;DR); // SSP0
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // hora[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCLLI = 0;

LPC_GPDMACH0-&amp;gt;DMACCControl = 7 | ( 1 &amp;lt;&amp;lt; 26 ); // Transfer size = 25 bytes and enable source increment.

LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 0 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set MAT1.0 as destination request peripheral and the type pf transfer as Memory to Peripheral.
LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0

//LPC_TIM1-&amp;gt;IR |= 0xff; // Clear all timer interrupts if there are any
//LPC_TIM1-&amp;gt;TCR |= 2;// Pongo a 0 el Contador del Timer
//LPC_TIM1-&amp;gt;TCR &amp;amp;= ~2;// Des-reseteo el Contador del Timer
//LPC_TIM1-&amp;gt;TCR = 0x01; // start timer.

while ( 1 ){
}
}
void SSP0Init( void ){

&amp;nbsp; LPC_SC-&amp;gt;PCONP |= (0x1&amp;lt;&amp;lt;21);//Damos alimentacion al módulo SPP0

&amp;nbsp; LPC_SC-&amp;gt;PCLKSEL1 &amp;amp;= ~(3 &amp;lt;&amp;lt; 10); //Borramos bits
&amp;nbsp; LPC_SC-&amp;gt;PCLKSEL1 |=&amp;nbsp; (1 &amp;lt;&amp;lt; 10); // set to "01" = Core Clock (100 MHz) 10nseg Tick

&amp;nbsp; /* P0.15~0.18 as SSP0 */
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~(0x3UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 |= (0x2UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2)|(0x3&amp;lt;&amp;lt;4));
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 |= ((0x2&amp;lt;&amp;lt;0)|(0x2&amp;lt;&amp;lt;2)|(0x2&amp;lt;&amp;lt;4));

&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~(0x3&amp;lt;&amp;lt;0);
&amp;nbsp; LPC_GPIO0-&amp;gt;FIODIR |= (0x1&amp;lt;&amp;lt;16);/* P0.16 defined as GPIO and Outputs */

&amp;nbsp; /* Set DSS data to 8-bit, Frame format SPI, CPOL = 0, CPHA = 0, and SCR is 7+1 */
&amp;nbsp; LPC_SSP0-&amp;gt;CR0 = (0x7 | 0x100);

&amp;nbsp; /* SSPCPSR clock prescale register, master mode, minimum divisor is 0x02 */
&amp;nbsp; LPC_SSP0-&amp;gt;CPSR = 0x8;

&amp;nbsp; /* Device select as master, SSP Enabled */
&amp;nbsp; /* Master mode */
&amp;nbsp; LPC_SSP0-&amp;gt;CR1 = (1 &amp;lt;&amp;lt; 1);

&amp;nbsp; /* Enable SSP0 for DMA. */
&amp;nbsp; LPC_SSP0-&amp;gt;DMACR = 0x2;
&amp;nbsp; return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a mix of some examples I found.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run this I obtain this on SPI CLK pin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;[img=640x480]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.flickr.com%2Fphotos%2F117247358%40N03%2F13254512955%2F%5B%2Fimg%5D" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.flickr.com/photos/117247358@N03/13254512955/[/img]&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see SCK is 2V before SSP is configured. When SSP is configured as SPI CLK is going low. 5useg later I read 7 bytes comes out from SPI. But, if you see my code, I've never start the timer. So what am i doing wrong? why DMA activated just before I enable it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thk!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520449#M3644</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520450#M3645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Thu Mar 20 19:30:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe this is easy to find the answer for.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not been doing any SSP/SPI myself, however, I've been doing Timer and DMA transfers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you're experiencing is something that resembles a race condition.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't stop the timer before configuring it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You set up the DMA and start it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You then set up the timer and clear the interrupt pending bits.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that you never stopped the timer before setting up the DMA, so the timer interrupt fires because you're changing the match registers while it's running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's all caused by the pending bits not been cleared before you enable a peripheral (the DMA in this case).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Solution:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Freeze both timer and DMA before you start manipulating their registers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list=1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Freeze DMA&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(in this case you want to freeze the DMA before the timer, because the DMA automatically transfers the data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Freeze Timer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Mess with Timer's registers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Mess with DMA's registers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Mess some more with Timer's registers if you want to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Clear DMA's pending interrupt bits.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Clear Timer's pending interrupt bits.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Enable the DMA (first, because it does not fire by itself).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(from this point on, DMA transfers might fire).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]Enable the Timer, which causes the DMA to fire at some point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In cases like this, you need to be precise in which order you write your code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Don't just do as I say. Do it because you &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;know why&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;what will happen&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt;. :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also: You can use the NVIC functions to first disable both the Timer and DMA, and as the last thing, enable both of them again. The NVIC can disable the interrupts, &lt;/SPAN&gt;&lt;STRONG&gt;&lt;I&gt;before&lt;/I&gt;&lt;/STRONG&gt;&lt;SPAN&gt; you turn on clock power for the peripherals; it's very good to do so. Enable the NVIC interrupts after you enable the DMA and Timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why disable the interrupt, when you know it's at the start of your code ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Well, the microcontroller may just have been reset again, after enabling the interrupts, so the interrupts could still be running.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520450#M3645</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520451#M3646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Fri Mar 21 18:12:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, I understand what you say.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While you answer me I change a litle my code to this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
int main (void){

SSP0Init();// Inicializo el bus SPI

// setup timer1
LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 2; // Power up
LPC_SC-&amp;gt;PCLKSEL0 |= 0x01 &amp;lt;&amp;lt; 4; // CCLK -&amp;gt; 10nseg ticks
LPC_TIM1-&amp;gt;MR0 = 2000;// Match a los 20 useg
LPC_TIM1-&amp;gt;MCR = 1 &amp;lt;&amp;lt; 1; // reset on Match Compare 0

LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 29; // Power up DMA

LPC_GPDMACH0-&amp;gt;DMACCConfig = 0; // stop ch0 dma

LPC_GPDMA-&amp;gt;DMACConfig |= 1 &amp;lt;&amp;lt; 0; // enable DMA
LPC_SC-&amp;gt;DMAREQSEL |= 1 &amp;lt;&amp;lt; 2; // Timer1 Match Compare 0 as DMA request

LPC_GPDMA-&amp;gt;DMACIntErrClr |= 0xff;
LPC_GPDMA-&amp;gt;DMACIntTCClear |= 0xff;

&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // hora[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCDestAddr = (uint32_t) &amp;amp;(LPC_SSP0-&amp;gt;DR); // SSP0
LPC_GPDMACH0-&amp;gt;DMACCLLI = 0;
LPC_GPDMACH0-&amp;gt;DMACCControl = 8 | (2 &amp;lt;&amp;lt; 12) | (2 &amp;lt;&amp;lt; 15) | ( 1 &amp;lt;&amp;lt; 26 ); // Transfer size = 25 bytes and enable source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 10 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set MAT1.0 as destination request peripheral and the type pf transfer as Memory to Peripheral.
LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0

LPC_TIM1-&amp;gt;IR |= 0xff; // Clear all timer interrupts if there are any
LPC_TIM1-&amp;gt;TCR |= 2;// Pongo a 0 el Contador del Timer
LPC_TIM1-&amp;gt;TCR &amp;amp;= ~2;// Des-reseteo el Contador del Timer
LPC_TIM1-&amp;gt;TCR = 0x01; // start timer.



while (LPC_GPDMACH0-&amp;gt;DMACCConfig &amp;amp; 1);

LPC_GPDMACH0-&amp;gt;DMACCControl = 8 // Transferencia de 8 bytes, 1 burst
| (2 &amp;lt;&amp;lt; 12) // Burst de 8 bytes
| (2 &amp;lt;&amp;lt; 15) // Burst de 8 bytes
| ( 1 &amp;lt;&amp;lt; 26 ); // Source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0

while ( 1 ){
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now it's working rigth. Take a look at this register configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
LPC_SC-&amp;gt;DMAREQSEL |= 1 &amp;lt;&amp;lt; 2; // Timer1 Match Compare 0 as DMA request
....
LPC_GPDMACH0-&amp;gt;DMACCControl = 8 // Transferencia de 8 bytes, 1 burst
| (2 &amp;lt;&amp;lt; 12) // Burst de 8 bytes
| (2 &amp;lt;&amp;lt; 15) // Burst de 8 bytes
| ( 1 &amp;lt;&amp;lt; 26 ); // Source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 10 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set MAT1.0 as destination request peripheral and the type pf transfer as Memory to Peripheral.
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my previouse code I assign SSP on GPDMACH0 control register (0) and not MAT1.0 (8)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a little confused with DMA REQSEL and dest peripheral on chanel 0 dma config.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me ask you something:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to trsnasfer 320 bits on SPI0 and on the same time 320bits on SPI1. Both of them with DMA. Can LPC1769 do that? or there will be a litle diferent time between SPI0 and SPI1?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I configure SPI for 32bits transfer and DMA for 10 burst I think that I see a litle dead time betwwen word and word, I don't see a constant 320 clk pulse. Is this rigth?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank for you answer, and sorry by me english!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520451#M3646</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520452#M3647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Fri Mar 21 18:48:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I don't understand Transfer Size, Source burst size, destination burst size, source transfer width and destination transfer width....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a 32 char array. I want to send them all just on 1 transfer by SPI. How do I need to configure DMA ch0 control register?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thk, and best regards!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520452#M3647</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520453#M3648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Mon Mar 24 06:58:40 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really need some support about it...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm testing this other code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
char data[64]={1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2};

#include &amp;lt;cr_section_macros.h&amp;gt;
#include &amp;lt;NXP/crp.h&amp;gt;

void SSP0Init();

/*******************************************************************************
**&amp;nbsp;&amp;nbsp; Main Function&amp;nbsp; main()
*******************************************************************************/
int main (void){

SSP0Init();// Inicializo el bus SPI

LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 29; // Power up DMA

LPC_GPDMACH0-&amp;gt;DMACCConfig = 0; // stop ch0 dma
//LPC_SC-&amp;gt;DMAREQSEL |= 1 &amp;lt;&amp;lt; 2; // Timer1 Match Compare 0 as DMA request

&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // data[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCDestAddr = (uint32_t) &amp;amp;(LPC_SSP0-&amp;gt;DR); // SSP0
LPC_GPDMACH0-&amp;gt;DMACCLLI = 0;
LPC_GPDMACH0-&amp;gt;DMACCControl = 32 // Transferencia de 32 bytes, 1 burst
| (1 &amp;lt;&amp;lt; 12) // Burst de 1 bytes
| (1 &amp;lt;&amp;lt; 15) // Burst de 1 bytes
| ( 1 &amp;lt;&amp;lt; 26 ); // Source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 0 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set SPI as destination request peripheral and the type pf transfer as Memory to Peripheral.

LPC_GPDMA-&amp;gt;DMACIntErrClr |= 0xff;//Clear all DMA interrupts
LPC_GPDMA-&amp;gt;DMACIntTCClear |= 0xff;

LPC_GPDMA-&amp;gt;DMACConfig |= 1 &amp;lt;&amp;lt; 0; // enable DMA
LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0

while ( 1 ){
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In these case I don't configure DMAREQSEL and set SPI tx as "destination request peripheral". I try to send 32bytes. This is the only code that works well. But I don't understand "destination request peripheral"... what is it? wich is the purpose of DMAREQSEL?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In these code I have SPI configured for 8bits long. So when I connect the oscilloscope on SPI Clock I see 32 groups of 8 clock pulse. But I see a litle space (1 clock?) between each byte. Can I remove this space with some configuration change? becouse I will need to configure SPI for 32bits long but I need to Send 320 bits...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, what if I want to activate DMA with a timer mach register? My code need to read EINT1, on ISR I configure Timer1 Match register 0 to 10usec. I would like to this match fire DMA to SPI transfer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I write this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/*******************************************************************************
**&amp;nbsp;&amp;nbsp; Main Function&amp;nbsp; main()
*******************************************************************************/
int main (void){

SSP0Init();// Inicializo el bus SPI

// setup timer1
LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 2; // Power up
LPC_SC-&amp;gt;PCLKSEL0 |= 0x01 &amp;lt;&amp;lt; 4; // CCLK -&amp;gt; 10nseg ticks
LPC_TIM1-&amp;gt;MR0 = 2000;// Match a los 10 segundos
LPC_TIM1-&amp;gt;MCR = 1 &amp;lt;&amp;lt; 1; // reset on Match Compare 0

LPC_TIM1-&amp;gt;IR |= 0xff; // Clear all timer interrupts if there are any
LPC_TIM1-&amp;gt;TCR = 2;// Pongo a 0 el Contador del Timer y queda desabilitado

LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 29; // Power up DMA

LPC_GPDMACH0-&amp;gt;DMACCConfig = 0; // stop ch0 dma

LPC_SC-&amp;gt;DMAREQSEL |= 1 &amp;lt;&amp;lt; 2; // Timer1 Match Compare 0 as DMA request

LPC_GPDMA-&amp;gt;DMACIntErrClr |= 0xff;
LPC_GPDMA-&amp;gt;DMACIntTCClear |= 0xff;

&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // hora[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCDestAddr = (uint32_t) &amp;amp;(LPC_SSP0-&amp;gt;DR); // SSP0
LPC_GPDMACH0-&amp;gt;DMACCLLI = 0;
LPC_GPDMACH0-&amp;gt;DMACCControl = 16 // Transferencia de 16 bytes
| (1 &amp;lt;&amp;lt; 12) // Burst de 8 bytes
| (1 &amp;lt;&amp;lt; 15) // Burst de 8 bytes
| (1 &amp;lt;&amp;lt; 26 ); // Source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 10 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set MAT1.0 as destination request peripheral and the type pf transfer as Memory to Peripheral.

LPC_GPDMA-&amp;gt;DMACConfig |= 1 &amp;lt;&amp;lt; 0; // enable DMA
LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0
LPC_TIM1-&amp;gt;TCR = 0x01; // start timer.

while ( 1 ){
}
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see I configure all on main.c to go step by step.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here I have DMAREQSEL and destination request peripheral doubt. What shoud I use on each register?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On this code I try to send 16 bytes once Timer1 Match0 fire. What I see on my osccilloscope is 20useg, a group of 4byte, 20useg, another group of 4byte and so on until 16 bytes is send. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the code and set SPI as destination request periperal:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 0 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set SPI as destination request peripheral and the type pf transfer as Memory to Peripheral.
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;What I see is 16 groups of pulse, but no 20usec on the first pulse. When I enable DMA it's fire without waiting for timer1 match0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I can change all my code logic, I can configure Match register 0 on EINT1 to produce interrupt, and on interrupt I can fire DMA manually, but I need to understand each regiter before I use DMA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any documentation for DMA? I already read UM, but it's not clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm really needing NXP support on it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thk and best regards!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520453#M3648</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520454#M3649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by embd02161991 on Tue Mar 25 22:17:00 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please read chapter-31 "General Purpose DMA" of the LPC176x user manual. It explains the DMA operations in detail with register descriptions. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The definitions for Transfer size, Source burst size, Destination burst size,Source and destination transfer width are available in Table 563- "DMA Channel Control Registers" on page 604.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fnxpfile%2Flpc17xx-user-manual" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/nxpfile/lpc17xx-user-manual&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP Technical Support&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520454#M3649</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520455#M3650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Wed Mar 26 03:41:51 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I write here, becouse I already read the UM and can't figure out how it work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just have one question. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How DMAREQSEL and Destination Request Peripheral of an specific chanel are related one each other?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to configure DMA, TIMER1 and SPI to send data (I'm using MOSI output only, not use SCKL, SSEL and MISO on my application) when Match Register 0 match Timer1 TC ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, I test code configuring DMAREQSEL with MAT1.0 and Chanel 0 Destination Request Peripheral with SPI. But this doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520455#M3650</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520456#M3651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Fri Mar 28 07:54:42 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sorry, that I'm not online so often.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* In DMAREQSEL, you enable those 'events' you want to be able to trigger the DMA transfer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Set the Destination Request Peripheral to 'subscribe' to an event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg. If the 'event' is not enabled in DMAREQSEL, you get nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On LPC43xx, I've used a timer to trigger a DMA transfer while also using the MAT1.0 and MAT1.1 to toggle pins. I've done the same thing on the LPC1768, so you should be able to do at least that. I have no experience with using the SPI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520456#M3651</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timer trigered DMA transfer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520457#M3652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elgarbe on Fri Mar 28 18:37:01 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Pacman&lt;/STRONG&gt;&lt;BR /&gt;I'm sorry, that I'm not online so often.&lt;BR /&gt;&lt;BR /&gt;See it like this:&lt;BR /&gt;* In DMAREQSEL, you enable those 'events' you want to be able to trigger the DMA transfer.&lt;BR /&gt;* Set the Destination Request Peripheral to 'subscribe' to an event.&lt;BR /&gt;Eg. If the 'event' is not enabled in DMAREQSEL, you get nothing.&lt;BR /&gt;&lt;BR /&gt;On LPC43xx, I've used a timer to trigger a DMA transfer while also using the MAT1.0 and MAT1.1 to toggle pins. I've done the same thing on the LPC1768, so you should be able to do at least that. I have no experience with using the SPI.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I have code with no DMAREQSEL configured and it work ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my las code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
int main (void){

SSP0Init();// Inicializo el bus SPI

// setup timer1
LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 2; // Power up
LPC_SC-&amp;gt;PCLKSEL0 |= 1 &amp;lt;&amp;lt; 4; // CCLK -&amp;gt; 10nseg ticks
LPC_TIM1-&amp;gt;MR0 = 2000;// Match a los 20 useg
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_TIM1-&amp;gt;MCR |= 3;//Interrupcion en Match R 0 y resetea el Contador

LPC_TIM1-&amp;gt;IR |= 0xff; // Clear all timer interrupts if there are any
LPC_TIM1-&amp;gt;TCR = 2;// Reset and Disable the timer
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Registramos la interrupcion del Timer2
&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_EnableIRQ(TIMER1_IRQn);

LPC_SC-&amp;gt;PCONP |= 1 &amp;lt;&amp;lt; 29; // Power up DMA

LPC_GPDMACH0-&amp;gt;DMACCConfig = 0; // stop ch0 dma

&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // data[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCDestAddr = (uint32_t) &amp;amp;(LPC_SSP0-&amp;gt;DR); // SSP0
LPC_GPDMACH0-&amp;gt;DMACCLLI = 0;
LPC_GPDMACH0-&amp;gt;DMACCControl = 16 // Transferencia de 16 half word
| (1 &amp;lt;&amp;lt; 12) // 0 burst
| (1 &amp;lt;&amp;lt; 15) // 0 burst
| (1 &amp;lt;&amp;lt; 18) // Half word width
| (1 &amp;lt;&amp;lt; 21) // Half word width
| (1 &amp;lt;&amp;lt; 26 ); // Source increment.
LPC_GPDMACH0-&amp;gt;DMACCConfig = ( 0 &amp;lt;&amp;lt; 6 ) | ( 1 &amp;lt;&amp;lt; 11); // Set SPI as destination request peripheral and the type pf transfer as Memory to Peripheral.
LPC_GPDMA-&amp;gt;DMACConfig |= 1 &amp;lt;&amp;lt; 0; // enable DMA

LPC_TIM1-&amp;gt;TCR = 1;// Enable the timer


while ( 1 ){
}
}
void SSP0Init( void ){

&amp;nbsp; LPC_SC-&amp;gt;PCONP |= (0x1&amp;lt;&amp;lt;21);//Damos alimentacion al módulo SPP0

&amp;nbsp; LPC_SC-&amp;gt;PCLKSEL1 &amp;amp;= ~(3 &amp;lt;&amp;lt; 10); //Borramos bits
&amp;nbsp; LPC_SC-&amp;gt;PCLKSEL1 |=&amp;nbsp; (1 &amp;lt;&amp;lt; 10); // set to "01" = Core Clock (100 MHz) 10nseg Tick

&amp;nbsp; /* P0.15~0.18 as SSP0 */
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~(0x3UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 |= (0x2UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2)|(0x3&amp;lt;&amp;lt;4));
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 |= ((0x2&amp;lt;&amp;lt;0)|(0x2&amp;lt;&amp;lt;2)|(0x2&amp;lt;&amp;lt;4));

&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~(0x3&amp;lt;&amp;lt;0);
&amp;nbsp; LPC_GPIO0-&amp;gt;FIODIR |= (0x1&amp;lt;&amp;lt;16);/* P0.16 defined as GPIO and Outputs */

&amp;nbsp; LPC_SSP0-&amp;gt;CR0 = ((15&amp;lt;&amp;lt;0) |//16-bits
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (0&amp;lt;&amp;lt;4) |//SPI
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (0&amp;lt;&amp;lt;6) |//CPOL=0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1&amp;lt;&amp;lt;7) | //CPHA=1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (7&amp;lt;&amp;lt;8) );//Serial Clock Rate = 7+1

&amp;nbsp; LPC_SSP0-&amp;gt;CR1 = (1 &amp;lt;&amp;lt; 1);//Not loop back, SSP enabled, Mater mode.

&amp;nbsp; LPC_SSP0-&amp;gt;CPSR = 2;//Clock Prescaler = 2. Fspi = 100MHz / (2*8) = 6.25MHz

&amp;nbsp; LPC_SSP0-&amp;gt;DMACR = 2;// Enable SSP1 for DMA.
&amp;nbsp; return;
}
void TIMER1_IRQHandler(void) {

LPC_TIM1-&amp;gt;IR |= 0xff; // Clear all timer interrupts if there are any

LPC_GPDMACH0-&amp;gt;DMACCSrcAddr = (uint32_t) &amp;amp;data[0]; // data[] is the array where I have stored alternating 1's and 0's.
LPC_GPDMACH0-&amp;gt;DMACCControl = 4 // Transferencia de 16 half word
| (1 &amp;lt;&amp;lt; 12) // 0 burst
| (1 &amp;lt;&amp;lt; 15) // 0 burst
| (1 &amp;lt;&amp;lt; 18) // Half word width
| (1 &amp;lt;&amp;lt; 21) // Half word width
| (1 &amp;lt;&amp;lt; 26 ); // Source increment.

LPC_GPDMA-&amp;gt;DMACIntErrClr |= 0xff;//Clear all DMA interrupts
LPC_GPDMA-&amp;gt;DMACIntTCClear |= 0xff;

LPC_GPDMACH0-&amp;gt;DMACCConfig |= 1; //enable ch0

}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't configure DMAREQSEL, I configure Timer1 match0 to generate an interrupt, and on ISR I configure DMA chanel and it fire when I enable the chanel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is ok for me. But I want to use MAT1.0 to fire DMA automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know some examples with DMA and Gpio using DMAREQSEL con MAT1.0 and Peripheral destination request to MAT1.0 too and it work. But I think this is an special using of combining DMAREQSEL and Periph dest req to see GPIO as pheriperal (becouse GPIO is memory for DMA)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thk and best regards!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW what happend with NXP people? the best answer I will get is "read the manual"? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:44:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Timer-trigered-DMA-transfer/m-p/520457#M3652</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:44:41Z</dc:date>
    </item>
  </channel>
</rss>

