<?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: SPI DMA, with fixed timing for DAC in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399035#M22085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Earl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, I successfully got it working! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;^Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2015 17:45:09 GMT</pubDate>
    <dc:creator>mathiaskoch</dc:creator>
    <dc:date>2015-06-18T17:45:09Z</dc:date>
    <item>
      <title>SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399030#M22080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently trying to work out how to get the SPI on my k20 to work with TX only DMA for a DAC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is, i have a buffer containing a signal sampled at some frequency, fs, and i need to recreate this signal using my SPI dac, DAC7811 from TI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a 12 bit dac with 4 control bits, eg i need to do DMA transfers of 16 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i need to write these 16 bits to the DAC at the same frequency as it is sampled? How can i do this? Until now i have been trying to use a PIT with a periodic trigger of FS and then use an always enabled source for the DMA. It seems to work, but i can quite work out how if i really have to start the SPI module every time in my DMA interrupt? Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPI0_MCR &amp;amp;= ~SPI_MCR_HALT;&lt;/P&gt;&lt;P&gt;while(!(SPI0_SR &amp;amp; SPI_SR_EOQF));&lt;/P&gt;&lt;P&gt;SPI0_SR |= SPI_SR_EOQF | SPI_SR_TCF ;&lt;/P&gt;&lt;P&gt;SPI0_MCR |= SPI_MCR_HALT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The perfect end result would be a circular DMA read from my buffer (using SMOD?), that i can start once, it would transfer the entire buffer through DMA (at specified FS) and it would stop itself at the end of the buffer and reload, ready&amp;nbsp; to be started again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really hope you can help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Mathias.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 09:23:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399030#M22080</guid>
      <dc:creator>mathiaskoch</dc:creator>
      <dc:date>2015-06-15T09:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399031#M22081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can keep the SPI always enabled (i.e. SPIx_MCR[HALT] = 0) and disable the SPI TX FIFO (i.e. register SPIx_MCR[DIS_TXF] = 1). If the SPIx_PUSHR[TXDATA] register is empty there won't be a transference but when it is not empty a SPI transference will start so you can configure a DMA channel with the transfer triggered by the PIT from your buffer to the SPIx_PUSHR[TXDATA] register. This will generate a transference every time the pit triggers the DMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The circular buffer is in charge of the DMA, you can configure the DMA with a major loop containing your entire buffer and configure the DMA_TCDn_SLAST register with the negative value of the amount of bytes of your buffer, this will make that after the last transaction in the major loop the source address returns to the beginning of the buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can configure two interrupts for the DMA channel, one when the half of the buffer is transmitted (DMA_TCDn_CSR[INTHALF]) and another when the buffer is fully transmitted(DMA_TCDn_CSR[INTMAJOR]), this is useful to manage a double buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Earl.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2015 21:35:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399031#M22081</guid>
      <dc:creator>EarlOrlando</dc:creator>
      <dc:date>2015-06-17T21:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399032#M22082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;Hi Earl&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;Thank you for your answer!&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;But i cant seem to make it work with the &lt;SPAN style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;SPI always enabled (i.e. SPIx_MCR[HALT] = 0). Even without adding in the DMA.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;SPAN style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;This is my setup code for the SPI:&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; if ((SIM_SCGC6 &amp;amp; SIM_SCGC6_SPI0) == 0) &lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC6 |= SIM_SCGC6_SPI0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR4 = PORT_PCR_MUX(2) | PORT_PCR_SRE | PORT_PCR_DSE; // CSn nRF24&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD_PCR6 = PORT_PCR_MUX(2) | PORT_PCR_SRE | PORT_PCR_DSE; // CSn DAC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR3 |= PORT_PCR_MUX(1); // CE output&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOC_PDDR |= _BV(3); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* PTC5, SPI0_SCK, ALT2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR5 = PORT_PCR_MUX(2) | PORT_PCR_SRE; // nRF24&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD_PCR1 = PORT_PCR_MUX(2) | PORT_PCR_SRE; // DAC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* PTC6, SPI0_SOUT, ALT2, internall pullup */&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR6 = PORT_PCR_MUX(2) | PORT_PCR_SRE | PORT_PCR_DSE; // nRF24&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD_PCR2 = PORT_PCR_MUX(2) | PORT_PCR_SRE | PORT_PCR_DSE; // DAC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* PTC7, SPI0_SIN, ALT2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTC_PCR7 = PORT_PCR_MUX(2) | PORT_PCR_PE; // nRF24&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_MCR = SPI_MCR_MDIS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_MCR = SPI_MCR_MSTR | SPI_MCR_MDIS | SPI_MCR_DIS_TXF | SPI_MCR_DIS_RXF | SPI_MCR_PCSIS(0x01) | SPI_MCR_PCSIS(0x08) | SPI_MCR_HALT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_CTAR1 = SPI_CTAR_FMSZ(7) | SPI_CTAR_PBR(0) | SPI_CTAR_BR(4) | SPI_CTAR_ASC(3); // 1.5 MHz clk&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_CTAR0 = SPI_CTAR_FMSZ(0xF) | SPI_CTAR_PBR(0) | SPI_CTAR_BR(0) | SPI_CTAR_ASC(0) | SPI_CTAR_CPHA; // 12 MHz clk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_RSER = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* enable DSPI clocks */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_MCR &amp;amp;= ~SPI_MCR_MDIS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SPI0_MCR &amp;amp;= ~SPI_MCR_HALT;&lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;And when i add in an entry, eg:&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;SPI0_PUSHR = (x | SPI_PUSHR_PCS(0x08) | SPI_PUSHR_EOQ | SPI_PUSHR_CTAS(0));&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;Nothing happens on the SPI pins?&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;Hope you can hep me -.-'&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P style="color: #999999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13.1999998092651px;"&gt;^Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 09:12:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399032#M22082</guid>
      <dc:creator>mathiaskoch</dc:creator>
      <dc:date>2015-06-18T09:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399033#M22083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind about the SPI part, i got that working..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i cant seem to make the DMA part to work with a PIT.. The PIT is running just fine, but what should i select as source for the DMA?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 10:03:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399033#M22083</guid>
      <dc:creator>mathiaskoch</dc:creator>
      <dc:date>2015-06-18T10:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399034#M22084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mathias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you are now able to start a SPI transference through writing a data in the SPIx_PUSHR register? If yes the only missing thing is the DMA configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try with the following function with the DMASourceAddress as your buffer address, DMADestinationAddress as the two low bits in the SPIx_PUSHR, SourceIncrement as 2 bytes, DestinationIncrement as 0 bytes, SourceOffset as the size in bytes of your buffer, DestinationOffset as 0, SizeElements as 1 for 2 bytes, Iterations as the amount of samples in your buffer, BytesPerTransaction two bytes and disableRequest as 0 for keep always the transactions enabled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_1434643776385999 jive_macro_code jive_text_macro" data-renderedposition="176_8_1232_576" jivemacro_uid="_1434643776385999" modifiedtitle="true"&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMAMUX_Channel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select the DMA channel that you want to configure.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SourceTrigger&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The trigger to start a transference.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMASourceAddress&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The source address.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMADestinationAddress&amp;nbsp;&amp;nbsp; The destination address.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SourceIncrement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The increment in bytes in the source address every time a transaction is done.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DestinationIncrement&amp;nbsp;&amp;nbsp;&amp;nbsp; The increment in bytes in the destination address every time a transaction is done.&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SourceOffset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The amount of bytes to add or subtract to the source address after a completion of a major loop (could be negative).&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DestinationOffset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The amount of bytes to add or subtract to the destination address after a completion of a major loop (could be negative).&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SizeElements&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The size of the data to transfer (0 -&amp;gt; 1 byte, 1 -&amp;gt; 2 bytes, 2 -&amp;gt; 4 bytes, 4 -&amp;gt; 16 bytes, 5 -&amp;gt; 32 bytes).&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Iterations&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; How many minor loops are in a major loop?&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BytesPerTransaction&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How many bytes are transferred in a minor loop?&lt;/P&gt;&lt;P&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disableRequest&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you want to disable the channel requests after a major loop?&lt;/P&gt;&lt;P&gt; */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void DMA_InitChannel(uint8_t DMAMUX_Channel, uint8_t SourceTrigger, uint32_t DMASourceAddress, uint32_t DMADestinationAddress, \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t SourceIncrement, uint8_t DestinationIncrement, int32_t SourceOffset, int32_t DestinationOffset,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint8_t SizeElements, uint16_t Iterations, uint16_t BytesPerTransaction, uint8_t disableRequest)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC7 |= SIM_SCGC7_DMA_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMAMUX_CHCFG(DMAMUX_Channel) |= DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(SourceTrigger);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Enable the channel and select the source trigger.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_SERQ |= DMA_SERQ_SERQ(DMAMUX_Channel);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Enable the request register for this channel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_SADDR(DMAMUX_Channel) = DMASourceAddress;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Select the source address.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_DADDR(DMAMUX_Channel) = DMADestinationAddress;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Select the destination address.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_SOFF(DMAMUX_Channel) = SourceIncrement;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Source offset (i.e. SOFF = 2 points to elements 0, 2, 4, etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_ATTR(DMAMUX_Channel) = DMA_ATTR_SSIZE(SizeElements) | DMA_ATTR_DSIZE(SizeElements);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Select elemnt's size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_NBYTES_MLNO(DMAMUX_Channel) = BytesPerTransaction;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Bytes per transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_SLAST(DMAMUX_Channel) = SourceOffset;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Source offset after a major iteration count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_DOFF(DMAMUX_Channel) = DestinationIncrement;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Destination offset (i.e. DOFF = 2 points to elements 0, 2, 4, etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_CITER_ELINKNO(DMAMUX_Channel) = DMA_CITER_ELINKNO_CITER(Iterations);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Iterations (minor loops).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_DLAST_SGA(DMAMUX_Channel) = DestinationOffset;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Destination offset after a major iteration count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_BITER_ELINKNO(DMAMUX_Channel) = DMA_BITER_ELINKNO_BITER(Iterations);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Iterations (minor loops).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_CSR(DMAMUX_Channel) = (disableRequest &amp;amp; 0x01) &amp;lt;&amp;lt; DMA_CSR_DREQ_SHIFT;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to configure the eDMA with the operation mode of periodic trigger (where the PIT 0 triggers the eDMA channel 0, the PIT 1 triggers the eDMA channel 1, etc.) through the register DMAMUX_CHCFGn[TRIG] (please see the description of this register).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Earl Orlando.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 16:51:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399034#M22084</guid>
      <dc:creator>EarlOrlando</dc:creator>
      <dc:date>2015-06-18T16:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399035#M22085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Earl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, I successfully got it working! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;^Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 17:45:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399035#M22085</guid>
      <dc:creator>mathiaskoch</dc:creator>
      <dc:date>2015-06-18T17:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: SPI DMA, with fixed timing for DAC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399036#M22086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to serve you :smileywink:.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day Mathias,&lt;/P&gt;&lt;P&gt;Earl.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 19:57:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-DMA-with-fixed-timing-for-DAC/m-p/399036#M22086</guid>
      <dc:creator>EarlOrlando</dc:creator>
      <dc:date>2015-06-18T19:57:43Z</dc:date>
    </item>
  </channel>
</rss>

