<?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>LPC MicrocontrollersのトピックRe: LPC1549 ADC with DMA problem</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224544#M43810</link>
    <description>&lt;P&gt;Hello Frank Meyer.&lt;/P&gt;&lt;P&gt;Thank you for answering.&lt;/P&gt;&lt;P&gt;I'm using the ping-pong buffer for the DMA, witch means the DMA changes the buffer it self. Maybe the buffer changes too early and the samples gets mixed together?&lt;/P&gt;&lt;P&gt;I would like to get the DMA to work and then I can increase the frequency.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jesper&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 08:48:41 GMT</pubDate>
    <dc:creator>jespermadsen</dc:creator>
    <dc:date>2021-02-02T08:48:41Z</dc:date>
    <item>
      <title>LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1223867#M43795</link>
      <description>&lt;P&gt;I copied this example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/DMA-Ping-Pong-application/ta-p/1120977" target="_self"&gt;https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/DMA-Ping-Pong-application/ta-p/1120977&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for the&amp;nbsp;LPCXpressor54114 Board and changed it to match the &amp;nbsp;LPC1549 LPCXpresso™ board.&lt;/P&gt;&lt;P&gt;As you can see there are a lot of pauses in the DMA sampling? Anybody knows what could be wrong?&lt;/P&gt;&lt;P&gt;The buffer size is 64&lt;/P&gt;&lt;P&gt;The sampling rate is 5000 Hz&lt;/P&gt;&lt;P&gt;The input signal is a 70 Hz triangle.&lt;/P&gt;&lt;P&gt;ADC-input:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ADC_input.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135579iB635D15A99744CA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC_input.png" alt="ADC_input.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Sampling without DMA:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ADC_samples_no_DMA.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135580i2D61B279CAE18F36/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC_samples_no_DMA.png" alt="ADC_samples_no_DMA.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Samples with DMA:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ADC_samples.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135581i9D0E1A8BD1FCABCE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC_samples.png" alt="ADC_samples.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Source code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include "chip.h"

#include &amp;lt;cr_section_macros.h&amp;gt;

//#define NO_DMA

#define NUM_BUFFERS 4
#define DMA_TRANSFER_SIZE 64
#define ADC_INPUT_CHANNEL 0

#define SCT_PWM_RATE   5000          /* PWM frequency 5 KHz */
#define SCT_PWM_PIN_OUT    3          /* COUT3 Generate square wave */
#define SCT_PWM_OUT        3          /* Index of OUT PWM */

uint16_t adcOut;

DMA_CHDESC_T ADC_TransferDescriptors[NUM_BUFFERS] __attribute__ ((aligned(512)));


uint16_t CapturedData[256];

/**
 *
 * ADC IRQ not Used right now... Only for testing
 */
void ADC_SEQA_IRQHandler(void)
{
            /* If SeqA flags is set i.e. data in global register is valid then read it */
        Chip_ADC_ClearFlags(LPC_ADC0,0xFFFFFFFF);
}

uint32_t buf_index = 0, rawSample;
void ADC0A_IRQHandler(void)
{
	uint32_t pending;

	/* Get pending interrupts */
	pending = Chip_ADC_GetFlags(LPC_ADC0);

	/* Sequence A completion interrupt */
	if (pending &amp;amp; ADC_FLAGS_SEQA_INT_MASK) {
		rawSample = Chip_ADC_GetSequencerDataReg(LPC_ADC0, ADC_SEQA_IDX);
		CapturedData[buf_index++] = (uint16_t)(rawSample &amp;amp; ADC_SEQ_GDAT_RESULT_MASK);
		if(buf_index &amp;gt; 255)
		{
			buf_index = 0;
		}
	}

	/* Clear any pending interrupts */
	Chip_ADC_ClearFlags(LPC_ADC0, pending);
}



void DMA_IRQHandler(void)
{
        static uint16_t DMA_Sum=0;

        DMA_Sum++;

         if(DMA_Sum == 8)
         {
           DMA_Sum = 4;
         }

     Chip_GPIO_SetPinOutHigh(LPC_GPIO, 0, 0);

     /* Error interrupt on channel 0? */
     if ((Chip_DMA_GetIntStatus(LPC_DMA) &amp;amp; DMA_INTSTAT_ACTIVEERRINT) != 0)
     {
          /* This shouldn't happen for this simple DMA example, so set the LED
             to indicate an error occurred. This is the correct method to clear
             an abort. */
          Chip_DMA_DisableChannel(LPC_DMA, DMA_CH0);
          while ((Chip_DMA_GetBusyChannels(LPC_DMA) &amp;amp; (1 &amp;lt;&amp;lt; DMA_CH0)) != 0) {}
          Chip_DMA_AbortChannel(LPC_DMA, DMA_CH0);
          Chip_DMA_ClearErrorIntChannel(LPC_DMA, DMA_CH0);
          Chip_DMA_EnableChannel(LPC_DMA, DMA_CH0);
     }

     Chip_GPIO_SetPinOutLow(LPC_GPIO, 0, 0);

     /* Clear DMA interrupt for the channel */
	Chip_DMA_ClearActiveIntAChannel(LPC_DMA, DMA_CH0);
}





     /***
      *      ____  __  __    _
      *     |  _ \|  \/  |  / \
      *     | | | | |\/| | / _ \
      *     | |_| | |  | |/ ___ \
      *     |____/|_|  |_/_/   \_\
      *     / ___|  ___| |_ _   _ _ __
      *     \___ \ / _ \ __| | | | '_ \
      *      ___) |  __/ |_| |_| | |_) |
      *     |____/ \___|\__|\__,_| .__/
      *                          |_|
      */
void DMA_Setup(void)
{
        DMA_CHDESC_T Initial_DMA_Descriptor;

     ADC_TransferDescriptors[0].source = (uint32_t)&amp;amp;LPC_ADC0-&amp;gt;SEQ_GDAT[0];
     ADC_TransferDescriptors[1].source = (uint32_t)&amp;amp;LPC_ADC0-&amp;gt;SEQ_GDAT[0];
     ADC_TransferDescriptors[2].source = (uint32_t)&amp;amp;LPC_ADC0-&amp;gt;SEQ_GDAT[0];
     ADC_TransferDescriptors[3].source = (uint32_t)&amp;amp;LPC_ADC0-&amp;gt;SEQ_GDAT[0];


     ADC_TransferDescriptors[0].dest = DMA_ADDR(&amp;amp;CapturedData[(0+1)*DMA_TRANSFER_SIZE-1]);
     ADC_TransferDescriptors[1].dest = DMA_ADDR(&amp;amp;CapturedData[(1+1)*DMA_TRANSFER_SIZE-1]);
     ADC_TransferDescriptors[2].dest = DMA_ADDR(&amp;amp;CapturedData[(2+1)*DMA_TRANSFER_SIZE-1]);
     ADC_TransferDescriptors[3].dest = DMA_ADDR(&amp;amp;CapturedData[(3+1)*DMA_TRANSFER_SIZE-1]);

     //The initial DMA desciptor is the same as the 1st transfer descriptor.   It
     //Will link into the 2nd of the main descriptors.

     ADC_TransferDescriptors[0].next = (uint32_t)&amp;amp;ADC_TransferDescriptors[1];
     ADC_TransferDescriptors[1].next = (uint32_t)&amp;amp;ADC_TransferDescriptors[2];
     ADC_TransferDescriptors[2].next = (uint32_t)&amp;amp;ADC_TransferDescriptors[3];

     //Link back to the 1st descriptor
     ADC_TransferDescriptors[3].next = (uint32_t)&amp;amp;ADC_TransferDescriptors[0];

     //For a test,  stop the transfers here.   The sine wave will look fine.
     //ADC_TransferDescriptors[3].next = 0;

     ADC_TransferDescriptors[0].xfercfg = (DMA_XFERCFG_CFGVALID |
                               DMA_XFERCFG_RELOAD  |
                               DMA_XFERCFG_SETINTA |
                               DMA_XFERCFG_WIDTH_16 |
                               DMA_XFERCFG_SRCINC_0 |
                               DMA_XFERCFG_DSTINC_1 |
                               DMA_XFERCFG_XFERCOUNT(DMA_TRANSFER_SIZE));

     ADC_TransferDescriptors[1].xfercfg = ADC_TransferDescriptors[0].xfercfg;
     ADC_TransferDescriptors[2].xfercfg = ADC_TransferDescriptors[0].xfercfg;

     ADC_TransferDescriptors[3].xfercfg = (DMA_XFERCFG_CFGVALID |
                               DMA_XFERCFG_RELOAD  |
                               DMA_XFERCFG_SETINTA |
                              DMA_XFERCFG_WIDTH_16 |
                              DMA_XFERCFG_SRCINC_0 |
                              DMA_XFERCFG_DSTINC_1 |
                              DMA_XFERCFG_XFERCOUNT(DMA_TRANSFER_SIZE));

     Initial_DMA_Descriptor.source = ADC_TransferDescriptors[0].source;
     Initial_DMA_Descriptor.dest =   ADC_TransferDescriptors[0].dest;
     Initial_DMA_Descriptor.next =  (uint32_t)&amp;amp;ADC_TransferDescriptors[1];
     Initial_DMA_Descriptor.xfercfg = ADC_TransferDescriptors[0].xfercfg;

     /* DMA initialization - enable DMA clocking and reset DMA if needed */
     Chip_DMA_Init(LPC_DMA);

     /* Enable DMA controller and use driver provided DMA table for current descriptors */
     Chip_DMA_Enable(LPC_DMA);
     Chip_DMA_SetSRAMBase(LPC_DMA, DMA_ADDR(Chip_DMA_Table));

     /* Setup channel 0 for the following configuration:
        - High channel priority
        - Interrupt A fires on descriptor completion */
     Chip_DMA_EnableChannel(LPC_DMA, DMA_CH0);
     Chip_DMA_EnableIntChannel(LPC_DMA, DMA_CH0);
     Chip_DMA_SetupChannelConfig(LPC_DMA, DMA_CH0,     //(DMA_CFG_PERIPHREQEN     |
                                   (DMA_CFG_HWTRIGEN        |
                                    DMA_CFG_TRIGBURST_BURST |
                                    DMA_CFG_TRIGTYPE_EDGE   |
                                    DMA_CFG_TRIGPOL_HIGH  |    //DMA_CFG_TRIGPOL_HIGH
                                    DMA_CFG_BURSTPOWER_1    |
                                    DMA_CFG_CHPRIORITY(0)
                                    )
                                    );


     //make sure ADC Sequence A interrupts is selected for for a DMA trigger
     Chip_INMUX_SetDMATrigger(DMA_CH0, DMATRIG_ADC0_SEQA_IRQ);

     /* Enable DMA interrupt */
     NVIC_EnableIRQ(DMA_IRQn);

     // The 1st descriptor is set up through the registers.

     /* Setup transfer descriptor and validate it */
     Chip_DMA_SetupTranChannel(LPC_DMA, DMA_CH0, &amp;amp;Initial_DMA_Descriptor);

     //Use the transfer configuration for our 4 main descriptors
     Chip_DMA_SetupChannelTransfer(LPC_DMA, DMA_CH0,     ADC_TransferDescriptors[0].xfercfg);
     Chip_DMA_SetValidChannel(LPC_DMA, DMA_CH0);
}

void SCT_PWM_Generate(void)
{
     /* Initialize the SCT2 as PWM and set frequency */
     Chip_SCTPWM_Init(LPC_SCT2);
     Chip_SCTPWM_SetRate(LPC_SCT2, SCT_PWM_RATE);

     /* Use SCT2_OUT3 pin */
     Chip_SCTPWM_SetOutPin(LPC_SCT2, SCT_PWM_OUT, SCT_PWM_PIN_OUT);

     /* Start with 50% duty cycle */
     Chip_SCTPWM_SetDutyCycle(LPC_SCT2, SCT_PWM_OUT, Chip_SCTPWM_PercentageToTicks(LPC_SCT2, 10));
     Chip_SCTPWM_Start(LPC_SCT2);
}


     /***
           *         _    ____   ____
           *        / \  |  _ \ / ___|
           *       / _ \ | | | | |
           *      / ___ \| |_| | |___
           *     /_/__ \_\____/ \____|
           *     / ___|  ___| |_ _   _ _ __
           *     \___ \ / _ \ __| | | | '_ \
           *      ___) |  __/ |_| |_| | |_) |
           *     |____/ \___|\__|\__,_| .__/
           *                          |_|
           */
void ADC_Setup(void)
{
     /* Initialization ADC to 12 bit and set clock divide to 1 to operate synchronously at System clock */
    Chip_ADC_Init(LPC_ADC0, ADC_CR_BITACC(0) | ADC_CR_CLKDIV(0)| ADC_CR_ASYNMODE);
	Chip_ADC_SetClockRate(LPC_ADC0, ADC_MAX_SAMPLE_RATE);
    //select ADC Channel 0 as input
    Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 8, IOCON_FUNC0 | IOCON_ADMODE_EN | IOCON_S_MODE_0CLK | IOCON_MODE_INACT);

    Chip_SWM_Init();
	Chip_SWM_EnableFixedPin(SWM_FIXED_ADC0_0);	//P0_8

    Chip_ADC_SetADC0Input(LPC_ADC0, ADC_INSEL_ADC0);

    //Setup ADC0_SEQA_IRQ
    Chip_ADC_SetupSequencer(LPC_ADC0,ADC_SEQA_IDX,
                              ADC_SEQ_CTRL_SEQ_ENA |
                              ADC_SEQ_CTRL_CHANSEL(ADC_INPUT_CHANNEL) |
                              ADC0_SEQ_CTRL_HWTRIG_SCT2_OUT3 |
//                              ADC_SEQ_CTRL_HWTRIG_POLPOS |
//                              ADC_SEQ_CTRL_HWTRIG_SYNCBYPASS |
                              ADC_SEQ_CTRL_MODE_EOS);

    /* Enable Sequence A interrupt */
	Chip_ADC_EnableInt(LPC_ADC0, ADC_INTEN_SEQA_ENABLE);

	/* Calibrate ADC */
//	Chip_ADC_SetTrim(LPC_ADC0, ADC_TRIM_VRANGE_HIGHV);
	Chip_ADC_StartCalibration(LPC_ADC0);
	while (!(Chip_ADC_IsCalibrationDone(LPC_ADC0))) {}

	Chip_ADC_ClearFlags(LPC_ADC0, Chip_ADC_GetFlags(LPC_ADC0));

	NVIC_EnableIRQ(ADC0_SEQA_IRQn);

	Chip_ADC_EnableSequencer(LPC_ADC0, ADC_SEQA_IDX);

}

int main(void) {
    // Read clock settings and update SystemCoreClock variable
    SystemCoreClockUpdate();

	Chip_GPIO_Init(LPC_GPIO);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 0);

#ifndef NO_DMA
    DMA_Setup();
#endif

    ADC_Setup();
    SCT_PWM_Generate();


    while(1)
    {}
    return 0 ;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 08:00:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1223867#M43795</guid>
      <dc:creator>jespermadsen</dc:creator>
      <dc:date>2021-02-01T08:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1223965#M43798</link>
      <description>&lt;P&gt;&amp;nbsp;Hi, Jesper,&lt;/P&gt;
&lt;P&gt;I suppose that you use both DMA and ADC Interrupt to read the ADC sample, how about disabling the ADC interrupt in ADC_Setup(); with removing the lines:&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;Chip_ADC_EnableInt(LPC_ADC0, ADC_INTEN_SEQA_ENABLE);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;NVIC_EnableIRQ(ADC0_SEQA_IRQn);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if it is the cause, anyway, pls have a try.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;void ADC_Setup(void)
{
     /* Initialization ADC to 12 bit and set clock divide to 1 to operate synchronously at System clock */
    Chip_ADC_Init(LPC_ADC0, ADC_CR_BITACC(0) | ADC_CR_CLKDIV(0)| ADC_CR_ASYNMODE);
	Chip_ADC_SetClockRate(LPC_ADC0, ADC_MAX_SAMPLE_RATE);
    //select ADC Channel 0 as input
    Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 8, IOCON_FUNC0 | IOCON_ADMODE_EN | IOCON_S_MODE_0CLK | IOCON_MODE_INACT);

    Chip_SWM_Init();
	Chip_SWM_EnableFixedPin(SWM_FIXED_ADC0_0);	//P0_8

    Chip_ADC_SetADC0Input(LPC_ADC0, ADC_INSEL_ADC0);

    //Setup ADC0_SEQA_IRQ
    Chip_ADC_SetupSequencer(LPC_ADC0,ADC_SEQA_IDX,
                              ADC_SEQ_CTRL_SEQ_ENA |
                              ADC_SEQ_CTRL_CHANSEL(ADC_INPUT_CHANNEL) |
                              ADC0_SEQ_CTRL_HWTRIG_SCT2_OUT3 |
//                              ADC_SEQ_CTRL_HWTRIG_POLPOS |
//                              ADC_SEQ_CTRL_HWTRIG_SYNCBYPASS |
                              ADC_SEQ_CTRL_MODE_EOS);

    /* Enable Sequence A interrupt */
	Chip_ADC_EnableInt(LPC_ADC0, ADC_INTEN_SEQA_ENABLE);

	/* Calibrate ADC */
//	Chip_ADC_SetTrim(LPC_ADC0, ADC_TRIM_VRANGE_HIGHV);
	Chip_ADC_StartCalibration(LPC_ADC0);
	while (!(Chip_ADC_IsCalibrationDone(LPC_ADC0))) {}

	Chip_ADC_ClearFlags(LPC_ADC0, Chip_ADC_GetFlags(LPC_ADC0));

	NVIC_EnableIRQ(ADC0_SEQA_IRQn);

	Chip_ADC_EnableSequencer(LPC_ADC0, ADC_SEQA_IDX);

}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 09:44:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1223965#M43798</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-02-01T09:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224504#M43807</link>
      <description>&lt;P&gt;Superficially looking at the images, it seems both methods (with and without ADC interrupt) seem messed up.&lt;/P&gt;&lt;P&gt;As&amp;nbsp;xiangjun_rong suggested, I would restrict the code to one method. Either ADC interrupts or DMA.&lt;/P&gt;&lt;P&gt;Assuming you are sampling continuously, your problem might be buffer handling. Once one buffer is full, you need to either move the data, or swap the DMA buffers. Else the ADC/DMA chain will start to overwrite you data after one ADC sample time.&lt;/P&gt;&lt;P&gt;For low sampling rates (like 5kHz), buffer management can still be handled with ADC interrupts, without a large performance penalty.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 08:16:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224504#M43807</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-02-02T08:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224528#M43809</link>
      <description>&lt;P&gt;Hello&amp;nbsp;xiangjun rong&lt;/P&gt;&lt;P&gt;Thank you for answering and sorry for the late response.&lt;/P&gt;&lt;P&gt;If I remove the line:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Chip_ADC_EnableInt(LPC_ADC0, ADC_INTEN_SEQA_ENABLE);&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I don't get any DMA interrupts. Could that be the problem?&lt;/P&gt;&lt;P&gt;And when I remove the line:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;NVIC_EnableIRQ(ADC0_SEQA_IRQn);&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It don't change the result.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jesper&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 08:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224528#M43809</guid>
      <dc:creator>jespermadsen</dc:creator>
      <dc:date>2021-02-02T08:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224544#M43810</link>
      <description>&lt;P&gt;Hello Frank Meyer.&lt;/P&gt;&lt;P&gt;Thank you for answering.&lt;/P&gt;&lt;P&gt;I'm using the ping-pong buffer for the DMA, witch means the DMA changes the buffer it self. Maybe the buffer changes too early and the samples gets mixed together?&lt;/P&gt;&lt;P&gt;I would like to get the DMA to work and then I can increase the frequency.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jesper&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 08:48:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224544#M43810</guid>
      <dc:creator>jespermadsen</dc:creator>
      <dc:date>2021-02-02T08:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224620#M43813</link>
      <description>&lt;P&gt;A ping-pong buffer would have been my suggested solution.&lt;/P&gt;&lt;P&gt;To be honest, I don't have much experience with the advanced DMA management on LPCs. I used a ADC/DMA chain regularly on other Cortex M devices, though. I usually had small buffers (like yours), and moved them in the DMA-ready interrupt - often with type conversion and scaling.&lt;/P&gt;&lt;P&gt;Probably DMA fills the buffers not in the order you think ...&lt;/P&gt;&lt;P&gt;I would read the DMA section of the MCU manual in that case.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 10:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224620#M43813</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-02-02T10:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1549 ADC with DMA problem</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224698#M43815</link>
      <description>&lt;P&gt;Hello Frank Meyer.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;The problem was this line:&lt;/P&gt;&lt;P&gt;Chip_DMA_SetSRAMBase(LPC_DMA, DMA_ADDR(Chip_DMA_Table));&lt;/P&gt;&lt;P&gt;it should have been this:&lt;/P&gt;&lt;P&gt;Chip_DMA_SetSRAMBase(LPC_DMA, DMA_ADDR(ADC_TransferDescriptors));&lt;/P&gt;&lt;P&gt;It was the wrong descriptors loaded into the DMA.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jesper&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 11:34:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1549-ADC-with-DMA-problem/m-p/1224698#M43815</guid>
      <dc:creator>jespermadsen</dc:creator>
      <dc:date>2021-02-02T11:34:18Z</dc:date>
    </item>
  </channel>
</rss>

