<?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: 4 ADC inputs in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290564#M45406</link>
    <description>&lt;P&gt;I think this is basically the same issue as the "Accuracy ADC" thread, which appears to be solved.&lt;/P&gt;&lt;P&gt;I don't understand how ADC clock issues could produce the described error pattern, though.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 08:11:24 GMT</pubDate>
    <dc:creator>frank_m</dc:creator>
    <dc:date>2021-06-10T08:11:24Z</dc:date>
    <item>
      <title>4 ADC inputs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1289218#M45353</link>
      <description>&lt;P&gt;Hi I am using the LPC54616J, I am trying to read 4 analogue inputs, channels 4, 5, 6 and 7. My problem is that when I have all 4 inputs configured, channels 5 and 6 do not read correctly, and I seem to have an 11 bit input. However, when I use channels 5 and 6 alone, they read correctly.&lt;/P&gt;&lt;P&gt;I attach code and configuration in case anyone knows what is happening to me.&lt;BR /&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define DEMO_ADC_BASE ADC0&lt;BR /&gt;#define DEMO_ADC_SAMPLE_CHANNEL_NUMBER 3U&lt;BR /&gt;#define DEMO_ADC_CLOCK_DIVIDER 2U&lt;/P&gt;&lt;P&gt;#define ADC_DIS 3U&lt;BR /&gt;#define ADCNS 5U&lt;BR /&gt;#define ADCE0 6U&lt;BR /&gt;#define ADCRSSI 4U&lt;/P&gt;&lt;P&gt;#define Fsampling 10&lt;BR /&gt;#define TSamplingMs (1000 / Fsampling)&lt;BR /&gt;/******************************************************//**&lt;BR /&gt;** Variables privadas&lt;BR /&gt;*********************************************************/&lt;/P&gt;&lt;P&gt;static TaskHandle_t _tskHandleADC; //&amp;lt; Manejador de la tarea de conversión del ADC&lt;BR /&gt;static GenRxCallBack_t _repDatTensiones; //&amp;lt; Función de call-back para el reporte de medidas del ADC.&lt;/P&gt;&lt;P&gt;/******************************************************//**&lt;BR /&gt;** Métodos privados&lt;BR /&gt;*********************************************************/&lt;/P&gt;&lt;P&gt;/*! \fn void _TskConvADC(void)&lt;BR /&gt;* \brief Tarea que realiza las lecturas del puerto ADC.&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;static void _TskConvADC(void)__attribute__((noreturn));&lt;BR /&gt;static void _TskConvADC(void)&lt;BR /&gt;{&lt;BR /&gt;adc_result_info_t ValTen;&lt;BR /&gt;ADC_savedat_t Save;&lt;BR /&gt;while(true)&lt;BR /&gt;{&lt;BR /&gt;ulTaskNotifyTake(pdFALSE, portMAX_DELAY);&lt;BR /&gt;/* Wait for the converter to be done. */&lt;BR /&gt;// ADC_GetChannelConversionResult(ADC0, ADC_DIS, &amp;amp;ValTen);&lt;BR /&gt;ADC_GetChannelConversionResult(ADC0, ADCNS, &amp;amp;ValTen);&lt;BR /&gt;Save.ADC_NS = ValTen.result;&lt;BR /&gt;ADC_GetChannelConversionResult(ADC0, ADC_DIS, &amp;amp;ValTen);&lt;BR /&gt;Save.ADC_Dis = ValTen.result;&lt;BR /&gt;ADC_GetChannelConversionResult(ADC0, ADCRSSI, &amp;amp;ValTen);&lt;BR /&gt;Save.ADC_RSSI = ValTen.result;&lt;/P&gt;&lt;P&gt;// ADC_ClearStatusFlags(ADC0, kADC_ConvSeqBInterruptFlag);&lt;BR /&gt;// ADC_DoSoftwareTriggerConvSeqB(ADC0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ADC_GetChannelConversionResult(ADC0, ADCE0, &amp;amp;ValTen);&lt;BR /&gt;Save.ADC_EO = ValTen.result;&lt;/P&gt;&lt;P&gt;//Mandamos los datos al módulo Mod_Operaciones&lt;BR /&gt;if(_repDatTensiones != NULL)&lt;BR /&gt;_repDatTensiones(&amp;amp;Save,sizeof(Save));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;} //void _TskConvADC(void)&lt;BR /&gt;/******************************************************//**&lt;BR /&gt;** Métodos públicos&lt;BR /&gt;*********************************************************/&lt;/P&gt;&lt;P&gt;/*! \fn void ADCinit(void)&lt;BR /&gt;* \brief Inicializa las conversiones AD.&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;void ADCinit(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BaseType_t xReturned;&lt;BR /&gt;// uint32_t frequency = 0U;&lt;BR /&gt;// ** Inicializa variables **&lt;BR /&gt;_repDatTensiones = NULL;&lt;/P&gt;&lt;P&gt;// ** Inicializa el driver **&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VDDA); /* Power on VDDA. */&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_ADC0); /* Power on the ADC converter. */&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VD2_ANA); /* Power on the analog power supply. */&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_VREFP); /* Power on the reference voltage source. */&lt;BR /&gt;ADC_DoSelfCalibration(ADC0);&lt;/P&gt;&lt;P&gt;if(!ModoConfig())&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;xReturned = xTaskCreate((TaskFunction_t)_TskConvADC,"TskConvADC",4 * configMINIMAL_STACK_SIZE, NULL, APP_TSK_HIGH_PRIORITY, &amp;amp;_tskHandleADC);&lt;BR /&gt;configASSERT(xReturned);&lt;/P&gt;&lt;P&gt;} //if(!ModoConfig())&lt;/P&gt;&lt;P&gt;} // void ADCinit(void)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*! \fn void AdcStartConv(void)&lt;BR /&gt;* \brief Fuerza la conversión(llamada por un timer).&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;void AdcStartConv(void)&lt;BR /&gt;{&lt;BR /&gt;// ** Fuerza el arranque de la conversión de la secuencia A **&lt;BR /&gt;// ADC_DoSoftwareTriggerConvSeqA(ADC0);&lt;BR /&gt;ADC_DoSoftwareTriggerConvSeqA(ADC0);&lt;/P&gt;&lt;P&gt;} // void AdcStartConv(void)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*! \fn void RepDatADC (GenRxCallBack_t callBack)&lt;BR /&gt;* \brief Establece la función de call-back para reporte de datos.&lt;BR /&gt;* \param[in] callBack Función que establecer.&lt;BR /&gt;* \return Nada.&lt;BR /&gt;*/&lt;BR /&gt;void RepDatADC (GenRxCallBack_t callBack)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;_repDatTensiones = callBack;&lt;/P&gt;&lt;P&gt;} //void RepDatADC (GenRxCallBack_t callBack)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* ADC0_SEQA_IRQn interrupt handler */&lt;/P&gt;&lt;P&gt;//void ADC0_ADC_SEQ_A_IRQHANDLER(void)&lt;BR /&gt;void ADC0_ADC_SEQ_A_IRQHANDLER(void)&lt;BR /&gt;{&lt;BR /&gt;BaseType_t tskWoken;&lt;/P&gt;&lt;P&gt;if (kADC_ConvSeqAInterruptFlag == (kADC_ConvSeqAInterruptFlag &amp;amp; ADC_GetStatusFlags(ADC0)))&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;ADC_ClearStatusFlags(ADC0, kADC_ConvSeqAInterruptFlag);&lt;BR /&gt;vTaskNotifyGiveFromISR(_tskHandleADC, &amp;amp;tskWoken);&lt;BR /&gt;portYIELD_FROM_ISR(tskWoken);&lt;/P&gt;&lt;P&gt;} // if (kADC_ConvSeqAInterruptFlag == (kADC_ConvSeqAInterruptFlag &amp;amp; ADC_GetStatusFlags(ADC0)))&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 14:26:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1289218#M45353</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-06-08T14:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: 4 ADC inputs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290367#M45391</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Do you say that the samples of all channels are okay after you changed the ADC clock frequency?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;BR /&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 03:02:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290367#M45391</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-06-10T03:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: 4 ADC inputs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290564#M45406</link>
      <description>&lt;P&gt;I think this is basically the same issue as the "Accuracy ADC" thread, which appears to be solved.&lt;/P&gt;&lt;P&gt;I don't understand how ADC clock issues could produce the described error pattern, though.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:11:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290564#M45406</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-06-10T08:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: 4 ADC inputs</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290567#M45407</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/26034"&gt;@xiangjun_rong&lt;/a&gt;&amp;nbsp; Hi, I solved it by lowering the frequency of the clock configured to read these ports, but I don't understand why the clock influences so much?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:16:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/4-ADC-inputs/m-p/1290567#M45407</guid>
      <dc:creator>Nadia</dc:creator>
      <dc:date>2021-06-10T08:16:58Z</dc:date>
    </item>
  </channel>
</rss>

