<?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>Kinetis Microcontrollers中的主题 Re: ADC Configuration</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177419#M1561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;| ADC_SC3_AVGS(AVGS_32);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this configuration,&amp;nbsp; you are actually taking 32 conversions and averaging per sample!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2011 19:19:45 GMT</pubDate>
    <dc:creator>emh203</dc:creator>
    <dc:date>2011-10-28T19:19:45Z</dc:date>
    <item>
      <title>ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177416#M1558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Kinetis documentation claims the ADC can be configured for a conversion time of 2us but the best I've seen is 72.8us. I'm using the Tower with the demo code and flipping a GPIO to measure on a scope.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTC_BASE_PTR-&amp;gt;PSOR |= (1 &amp;lt;&amp;lt; 3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ADC1_BASE_PTR-&amp;gt;SC1[0] = ADC_SC1_ADCH(20);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ( (ADC1_BASE_PTR-&amp;gt;SC1[0] &amp;amp; ADC_SC1_COCO_MASK) == 0 ){}&amp;nbsp; // Wait conversion end&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PTC_BASE_PTR-&amp;gt;PCOR |= (1 &amp;lt;&amp;lt; 3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This takes 72.8us. I've searched and searched for some kind of app note regarding the ADC configuration and I can't find any. Can anyone help me with an ADC configuration to get the claimed 2us conversion? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 12:44:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177416#M1558</guid>
      <dc:creator>frustrated</dc:creator>
      <dc:date>2011-10-27T12:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177417#M1559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could we see you code that sets up the ADC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 18:28:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177417#M1559</guid>
      <dc:creator>emh203</dc:creator>
      <dc:date>2011-10-27T18:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177418#M1560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm basically using the setup from ADC_Task.c in the Tower demo code but I've been tweeking it to try to get better conversion times. All the register macros are as defined in MK60N512VMD100.h. The Tower board I'm using seems to have about a 48MHz system clock. Any help is apprechiated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void InitializeADC()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; /* Turn on the ADCo and ADC1 clocks */&lt;BR /&gt;&amp;nbsp; SIM_SCGC6 |= (SIM_SCGC6_ADC0_MASK );&lt;BR /&gt;&amp;nbsp; SIM_SCGC3 |= (SIM_SCGC3_ADC1_MASK );&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; /* setup the initial configuration */&lt;BR /&gt;//&amp;nbsp; Master_Adc_Config.CONFIG1&amp;nbsp; = ADLPC_NORMAL | ADC_CFG1_ADIV(ADIV_4) | ADLSMP_LONG | ADC_CFG1_MODE(MODE_16)| ADC_CFG1_ADICLK(ADICLK_BUS);&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.CONFIG1&amp;nbsp; = ADLPC_NORMAL | ADC_CFG1_ADIV(ADIV_2) | ADC_CFG1_MODE(MODE_16)| ADC_CFG1_ADICLK(ADICLK_BUS_2);&lt;BR /&gt;//&amp;nbsp; Master_Adc_Config.CONFIG2&amp;nbsp; = MUXSEL_ADCA | ADACKEN_DISABLED | ADHSC_HISPEED | ADC_CFG2_ADLSTS(ADLSTS_20) ;&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.CONFIG2&amp;nbsp; = MUXSEL_ADCA | ADACKEN_DISABLED | ADHSC_HISPEED | ADC_CFG2_ADLSTS(ADLSTS_2) ;&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.COMPARE1 = 0x1234u ;&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.COMPARE2 = 0x5678u ;&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.STATUS2&amp;nbsp; = ADTRG_SW | ACFE_DISABLED | ACFGT_GREATER | ACREN_ENABLED | DMAEN_DISABLED | ADC_SC2_REFSEL(REFSEL_EXT);&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.STATUS3&amp;nbsp; = CAL_OFF | ADCO_SINGLE | AVGE_DISABLED | ADC_SC3_AVGS(AVGS_32);&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.PGA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = PGAEN_DISABLED | PGACHP_NOCHOP | PGALP_NORMAL | ADC_PGA_PGAG(PGAG_64);&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.STATUS1A = AIEN_OFF | DIFF_SINGLE | ADC_SC1_ADCH(31);&lt;BR /&gt;&amp;nbsp; Master_Adc_Config.STATUS1B = AIEN_OFF | DIFF_SINGLE | ADC_SC1_ADCH(31);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; ADC_Config_Alt(ADC1_BASE_PTR, &amp;amp;Master_Adc_Config);&amp;nbsp; // config ADC&lt;BR /&gt;&amp;nbsp; ADC_Cal(ADC1_BASE_PTR);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do the calibration&lt;BR /&gt;&amp;nbsp; ADC_Read_Cal(ADC1_BASE_PTR,&amp;amp;CalibrationStore[1]);&amp;nbsp;&amp;nbsp; // store the cal&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 11:56:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177418#M1560</guid>
      <dc:creator>frustrated</dc:creator>
      <dc:date>2011-10-28T11:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177419#M1561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;| ADC_SC3_AVGS(AVGS_32);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this configuration,&amp;nbsp; you are actually taking 32 conversions and averaging per sample!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 19:19:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177419#M1561</guid>
      <dc:creator>emh203</dc:creator>
      <dc:date>2011-10-28T19:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177420#M1562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have averaging disabled, note below in red&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿&amp;nbsp;Master_Adc_Config.STATUS3&amp;nbsp; = CAL_OFF | ADCO_SINGLE | &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;AVGE_DISABLED&lt;/STRONG&gt;&lt;/FONT&gt; | ADC_SC3_AVGS(AVGS_32);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2011 07:47:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177420#M1562</guid>
      <dc:creator>frustrated</dc:creator>
      <dc:date>2011-10-29T07:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177421#M1563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting..... I have some code I wrote based upon the same example.&amp;nbsp;&amp;nbsp; With the 32- Avergages enabled, I get about 20uS sample time (for&amp;nbsp; an audio appplication).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you using MQX or something similiar?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Oct 2011 02:29:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177421#M1563</guid>
      <dc:creator>emh203</dc:creator>
      <dc:date>2011-10-30T02:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177422#M1564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I'm using MQX. It is essentially verbatim from the Tower demo code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 12:26:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177422#M1564</guid>
      <dc:creator>frustrated</dc:creator>
      <dc:date>2011-10-31T12:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177423#M1565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to just try doing it bare metal. &amp;nbsp; &amp;nbsp;A context switch may be happening in your polling loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 03:43:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177423#M1565</guid>
      <dc:creator>emh203</dc:creator>
      <dc:date>2011-11-01T03:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177424#M1566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've also tried this in an ISR which I would think is immune to context switches. Plus within the task, if there were context switches, I would think that I would see variation in the pulse on the scope. It is rock solid. Also, there is abiguity in Freescale's documentation. The Kinetis datasheet claims the max ADC clock is 12Mhz for a 16 bit conversion. Their online ADC conversion calculator claims the max clock is 22Mhz. Which is correct? I'm using 48Mhz and it works but the conversion is taking 18us. If I prescale the clock to 12Mhz, the conversion time jumps to 72us. The ADC calculator says it should take 2.771us at 12MHz. Something is very wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 06:07:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177424#M1566</guid>
      <dc:creator>frustrated</dc:creator>
      <dc:date>2011-11-02T06:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177425#M1567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done some tests in 16 bit mode, with the following reference results. They look to be fairly similar to the ones suggested in the manuals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Conversion time was tested with several setups as reference (K60 running at 100MHz with bus clock at 50MHz):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ADC clock Bus-clock/2 - Pre-scaler /8 - 16 bit mode single-ended - long-sample (24 clocks) – 32x hardware averaging = 460us&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pre-scaler reducted to /1 = 56us&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+ Short-Sample mode = 32.4us&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+ Bus not divided by 2 = 16us&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+ No hardware averaging = 700ns&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In 16 bit mode the ADC clock should however be restricted to the range of 2MHz to 12MHz, meaning that not all conversion times can be achieved to specification. Practically, the bus clock needs to be divided by 8 to clock with 6.25MHz, which gives a minimum conversion time of 5.6us – or theoretical maximum sample rate of 178kHz. If the ADC clock can be controlled to be exactly 12MHz the minimum conversion time of 2.6us and maximum sample rate of 383kHz is obtained in 16 bit mode (remembering that this will achieve about 13 bits of accuracy)."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2012 22:51:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Configuration/m-p/177425#M1567</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2012-03-17T22:51:20Z</dc:date>
    </item>
  </channel>
</rss>

