<?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: DMA and UART (MCF52233)? in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129785#M700</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;- the access rights look good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that I see a tx error in the code:&lt;BR /&gt;- when setting up the DMA for transmission you have the source and destination inverted. Source must be your buffer and destination the TX register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you must also configure the UART but with disabled interrupt (if not already done).&lt;BR /&gt;If you now put 8 bytes into the tx buffer and enable the transmitter using &lt;BR /&gt;UMR1_2_0 = UART_TX_ENABLE; (your defines will be slightly different)&lt;BR /&gt;then the transmitter will start the DMA transfer process and after 8 bytes the DMA interrupt will occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the DMA status register if nothing happens since it will tell you if it aborted due to a bus error or similar and this will possibly indicate the source of any more problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the error with the inversion, the rest of the set up looks good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your interrupt routine you will then have to clear the DONE bit. I use the following sequence:&lt;BR /&gt;1. Disable DMA&lt;BR /&gt;2. Disable transmitter&lt;BR /&gt;3. Reset DONE bit&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 Butcher&lt;BR /&gt;&lt;A href="http://www.mjbc.ch/"&gt;www.mjbc.ch&lt;/A&gt; / &lt;A href="http://www.uTasker.com/"&gt;www.uTasker.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Sep 2006 07:19:31 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2006-09-12T07:19:31Z</dc:date>
    <item>
      <title>DMA and UART (MCF52233)?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129784#M699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use in my project interrupts for the UART communication. When I set greater UART speed, some byte wasn't sended or received, because the UART generates too many Interrupts! So I will use the DMA for UART. To reduce the interrupts, i will generate an DMA receiv or send interrupt when 8 Bytes are transferred to the RAM or over the UART! This is my init function for the DMA Controller. But with this init Code, I can't read or send Bytes over the UART! Hope, you can help me! Or you have Application Notes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static void init_dma0()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DMAREQC |= MCF_DMA_DMAREQC_DMAC2(0xC); // UART Transmit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DMAREQC |= MCF_DMA_DMAREQC_DMAC0(0x8); // UART Receive&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_SCM_GPACR0 |= 0x06; // Read, Write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_SCM_GPACR1 |= 0x06; // Read, Write&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_SCM_PACR2 |= 0x60; // Read, Write // UART&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_SAR0 = MCF_UART0_URB; // Receiver UART Buffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DAR0 = (volatile unsigned long)&amp;amp;recvBuf[0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_SAR2 = MCF_UART0_URB;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DAR2 = (volatile unsigned long)&amp;amp;sendBuf[0]; // Transmit UART Buffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR2 |= MCF_DMA_DCR_DSIZE(0x1) | // Destination Size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_SSIZE(0x1) | // Soure Size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_SINC | // Source Increment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_CS | // Single read/write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_INT; // Internal interrupt signal is enabled&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_AA; // Autoalign enable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR0 |= MCF_DMA_DCR_DSIZE(0x1) | // Destination Size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_SSIZE(0x1) | // Soure Size&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_DINC | // Destination Increment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_CS | // Single read/write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_EEXT | // Enable external request to initiate transfer&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_DCR_AA; // Autoalign enable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_SCM_RAMBAR |= (MCF_SCM_RAMBAR_BDE | MCF_RAMBAR_SPV); // Backdoor enable and SPV Secondary Port Valid&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_BCR2 = 8; // Byte Count Register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_DMA_BCR0 = 8; // Byte Count Register&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mcf5223_interrupt_init(9, 5, dma0_isr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mcf5223_interrupt_init(11, 6, dma0_isr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_INTC0_IMRL &amp;amp;= ~MCF_INTC_IMRL_MASK9;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_INTC0_IMRL &amp;amp;= ~MCF_INTC_IMRL_MASK11;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 19:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129784#M699</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2006-09-08T19:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: DMA and UART (MCF52233)?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129785#M700</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;- the access rights look good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that I see a tx error in the code:&lt;BR /&gt;- when setting up the DMA for transmission you have the source and destination inverted. Source must be your buffer and destination the TX register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you must also configure the UART but with disabled interrupt (if not already done).&lt;BR /&gt;If you now put 8 bytes into the tx buffer and enable the transmitter using &lt;BR /&gt;UMR1_2_0 = UART_TX_ENABLE; (your defines will be slightly different)&lt;BR /&gt;then the transmitter will start the DMA transfer process and after 8 bytes the DMA interrupt will occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the DMA status register if nothing happens since it will tell you if it aborted due to a bus error or similar and this will possibly indicate the source of any more problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the error with the inversion, the rest of the set up looks good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your interrupt routine you will then have to clear the DONE bit. I use the following sequence:&lt;BR /&gt;1. Disable DMA&lt;BR /&gt;2. Disable transmitter&lt;BR /&gt;3. Reset DONE bit&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 Butcher&lt;BR /&gt;&lt;A href="http://www.mjbc.ch/"&gt;www.mjbc.ch&lt;/A&gt; / &lt;A href="http://www.uTasker.com/"&gt;www.uTasker.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2006 07:19:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129785#M700</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2006-09-12T07:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: DMA and UART (MCF52233)?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129786#M701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Oh yes, I forgot to mention.&lt;BR /&gt;&lt;BR /&gt;What speed are you running the UART at?&lt;BR /&gt;The ColdFire should have enough processing power to handle interrupt operation on all UARTS at high rates without loosing interrupts.&lt;BR /&gt;If you are loosing them it may indicate other problems in your system (code segments disabling interrupts for quite long times?).&lt;BR /&gt;This is not to say that DMA should not be used because it is much more efficent in some cases (depening on protocol etc.) but it may be worth finding out why interrupts get lost in the first place.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2006 07:23:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/DMA-and-UART-MCF52233/m-p/129786#M701</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2006-09-12T07:23:49Z</dc:date>
    </item>
  </channel>
</rss>

