<?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: LPC51U68 ADC Config Problems</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086312#M41698</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;Yes my solution come mainly from the demo code, the code from the config tool do no function.&lt;BR /&gt;This is for measuring the battery tension.&lt;BR /&gt;As those microcontroller will be more and more used under battery power, it will be nice if that facility were integrated on silicium.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;JP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jun 2020 14:52:37 GMT</pubDate>
    <dc:creator>jplathuile</dc:creator>
    <dc:date>2020-06-17T14:52:37Z</dc:date>
    <item>
      <title>LPC51U68 ADC Config Problems</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086309#M41695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Concerning a LPC51U68 and his ADC.&lt;BR /&gt;From McuXpresso i use the configurator&lt;/P&gt;&lt;P&gt;that give me in peripherals.c&lt;/P&gt;&lt;P&gt;const adc_config_t ADC0configStruct = {&lt;BR /&gt; .clockMode = kADC_ClockSynchronousMode,&lt;BR /&gt; .clockDividerNumber = 8,&lt;BR /&gt; .resolution = kADC_Resolution12bit,&lt;BR /&gt; .sampleTimeNumber = 7,&lt;BR /&gt; .enableBypassCalibration = false&lt;BR /&gt;};&lt;BR /&gt;/* Conversion sequence A configuration structure */&lt;BR /&gt;const adc_conv_seq_config_t ADC0ConvSeqAConfigStruct = {&lt;BR /&gt; .channelMask = 1024U,&lt;BR /&gt; .triggerMask = 0U,&lt;BR /&gt; .triggerPolarity = kADC_TriggerPolarityPositiveEdge,&lt;BR /&gt; .enableSyncBypass = false,&lt;BR /&gt; .enableSingleStep = false,&lt;BR /&gt; .interruptMode = kADC_InterruptForEachConversion&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;void ADC0_init(void) {&lt;BR /&gt; /* Perform self calibration */&lt;BR /&gt; ADC_DoOffsetCalibration(ADC0_PERIPHERAL, ADC0_CLK_FREQ);&lt;BR /&gt; /* Initialize ADC0 peripheral */&lt;BR /&gt; ADC_Init(ADC0_PERIPHERAL, &amp;amp;ADC0configStruct);&lt;BR /&gt; /* Configure the conversion sequence A */&lt;BR /&gt; ADC_SetConvSeqAConfig(ADC0_PERIPHERAL, &amp;amp;ADC0ConvSeqAConfigStruct);&lt;BR /&gt; /* Enable the conversion sequence A */&lt;BR /&gt; ADC_EnableConvSeqA(ADC0_PERIPHERAL, true);&lt;BR /&gt; /* Configure threshold compare interrupt on channel 10 */&lt;BR /&gt; ADC_EnableThresholdCompareInterrupt(ADC0_PERIPHERAL, 10U, kADC_ThresholdInterruptDisabled);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;that is called at the very beginning&lt;/P&gt;&lt;P&gt;in the forever loop i use&lt;/P&gt;&lt;P&gt;POWER_DisablePD(kPDRUNCFG_PD_VREFP_SW);&lt;BR /&gt; POWER_DisablePD(kPDRUNCFG_PD_VD7_ENA);&lt;BR /&gt; POWER_DisablePD(kPDRUNCFG_PD_ADC0);&lt;BR /&gt; IOCON-&amp;gt;PIO[1][7] = ((IOCON-&amp;gt;PIO[1][7] &amp;amp; (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_MODE_MASK | IOCON_PIO_DIGIMODE_MASK))) /* Mask bits to zero which are setting */&lt;BR /&gt; | IOCON_PIO_FUNC(PIO17_FUNC_ALT0) /* Selects pin function.: PORT17 (pin 21) is configured as ADC0_10 */&lt;BR /&gt; | IOCON_PIO_MODE(PIO17_MODE_INACTIVE) /* Selects function mode (on-chip pull-up/pull-down resistor control).: Inactive. Inactive (no pull-down/pull-up resistor enabled). */&lt;BR /&gt; | IOCON_PIO_DIGIMODE(PIO17_DIGIMODE_ANALOG) /* Select Analog/Digital mode.: Analog mode. */&lt;BR /&gt; );&lt;BR /&gt; ADC_DoSoftwareTriggerConvSeqA(ADC0_PERIPHERAL); &lt;BR /&gt; &lt;BR /&gt; sysTickDelay(200);&lt;/P&gt;&lt;P&gt;ADC_GetChannelConversionResult(ADC0_PERIPHERAL, 10, &amp;amp;adcResultInfoStruct);&lt;BR /&gt; &lt;BR /&gt; uiVAlim = ((uiVAlim * 2.0) + adcResultInfoStruct.result) / 3.0;&lt;BR /&gt; IOCON-&amp;gt;PIO[1][7] = ((IOCON-&amp;gt;PIO[1][7] &amp;amp; (~(IOCON_PIO_FUNC_MASK | IOCON_PIO_MODE_MASK | IOCON_PIO_DIGIMODE_MASK))) /* Mask bits to zero which are setting */&lt;BR /&gt; | IOCON_PIO_FUNC(PIO17_FUNC_ALT0) /* Selects pin function.: PORT17 (pin 21) is configured as ADC0_10 */&lt;BR /&gt; | IOCON_PIO_MODE(PIO17_MODE_INACTIVE) /* Selects function mode (on-chip pull-up/pull-down resistor control).: Inactive. Inactive (no pull-down/pull-up resistor enabled). */&lt;BR /&gt; | IOCON_PIO_DIGIMODE(PIO18_DIGIMODE_DIGITAL) /* Select Analog/Digital mode.: Analog mode. */&lt;BR /&gt; );&lt;BR /&gt; POWER_EnablePD(kPDRUNCFG_PD_VREFP_SW);&lt;BR /&gt; POWER_EnablePD(kPDRUNCFG_PD_VD7_ENA);&lt;BR /&gt; POWER_EnablePD(kPDRUNCFG_PD_ADC0);&lt;/P&gt;&lt;P&gt;(use the errata datasheet recommandation to switch back to a digital , the adc input)&lt;/P&gt;&lt;P&gt;The clock used is the RTC with the PLL to get 9.3MHz&lt;/P&gt;&lt;P&gt;Every thing else doing pretty fine, it is a barometer with logger and i wish to use the ADC to surveil the battery power.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 17:38:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086309#M41695</guid>
      <dc:creator>jplathuile</dc:creator>
      <dc:date>2020-06-11T17:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: LPC51U68 ADC Config Problems</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086310#M41696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Problem come from the initialisation sequence in the Mcuxpresso config tool&lt;BR /&gt;the adc is not powered automatically nor the clock connected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void ADC_ClockPower_Configuration(void) {&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_ADC0); /* Power on the ADC converter. */&lt;BR /&gt; POWER_DisablePD(kPDRUNCFG_PD_VD7_ENA); /* Power on the analog power supply. */&lt;BR /&gt; POWER_DisablePD(kPDRUNCFG_PD_VREFP_SW); /* Power on the reference voltage source. */&lt;BR /&gt; POWER_DisablePD(kPDRUNCFG_PD_TEMPS); /* Power on the temperature sensor. */&lt;/P&gt;&lt;P&gt;CLOCK_EnableClock(kCLOCK_Adc0); /* SYSCON-&amp;gt;AHBCLKCTRL[0] |= SYSCON_AHBCLKCTRL_ADC0_MASK; */&lt;/P&gt;&lt;P&gt;const adc_config_t ADC0configStruct = {&lt;BR /&gt; .clockMode = kADC_ClockSynchronousMode,&lt;BR /&gt; .clockDividerNumber = 0,&lt;BR /&gt; .resolution = kADC_Resolution12bit,&lt;BR /&gt; .sampleTimeNumber = 0,&lt;BR /&gt; .enableBypassCalibration = false&lt;BR /&gt; };&lt;BR /&gt; /* Conversion sequence A configuration structure */&lt;BR /&gt; const adc_conv_seq_config_t ADC0ConvSeqAConfigStruct = {&lt;BR /&gt; .channelMask = 2048U,&lt;BR /&gt; .triggerMask = 0U,&lt;BR /&gt; .triggerPolarity = kADC_TriggerPolarityNegativeEdge,&lt;BR /&gt; .enableSyncBypass = false,&lt;BR /&gt; .enableSingleStep = false,&lt;BR /&gt; .interruptMode = kADC_InterruptForEachConversion&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /* Perform self calibration */&lt;BR /&gt; ADC_DoOffsetCalibration(ADC0, 12000000U);&lt;BR /&gt; /* Initialize ADC0 peripheral */&lt;BR /&gt; ADC_Init(ADC0, &amp;amp;ADC0configStruct);&lt;BR /&gt; /* Configure the conversion sequence A */&lt;BR /&gt; ADC_SetConvSeqAConfig(ADC0, &amp;amp;ADC0ConvSeqAConfigStruct);&lt;BR /&gt; /* Enable the conversion sequence A */&lt;BR /&gt; ADC_EnableConvSeqA(ADC0, true);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Called after&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BOARD_InitBootPins();&lt;BR /&gt; BOARD_InitBootClocks();&lt;/P&gt;&lt;P&gt;BOARD_InitBootPeripherals();&lt;BR /&gt; ADC_ClockPower_Configuration();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;JP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2020 20:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086310#M41696</guid>
      <dc:creator>jplathuile</dc:creator>
      <dc:date>2020-06-16T20:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPC51U68 ADC Config Problems</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086311#M41697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jean,&lt;/P&gt;&lt;P&gt;Thanks for your sharing, if still have problem, recommend you also can compare your code with ADC demo&lt;/P&gt;&lt;P&gt;under SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2020 09:20:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086311#M41697</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2020-06-17T09:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC51U68 ADC Config Problems</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086312#M41698</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;Yes my solution come mainly from the demo code, the code from the config tool do no function.&lt;BR /&gt;This is for measuring the battery tension.&lt;BR /&gt;As those microcontroller will be more and more used under battery power, it will be nice if that facility were integrated on silicium.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;JP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2020 14:52:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC51U68-ADC-Config-Problems/m-p/1086312#M41698</guid>
      <dc:creator>jplathuile</dc:creator>
      <dc:date>2020-06-17T14:52:37Z</dc:date>
    </item>
  </channel>
</rss>

