<?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: Continuous ADC in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379824#M21224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry I was not clear in my earlier post, all ADC channels are measuring with an offset (not just temp sensor) with the Init_ADC bean in continuous mode compared to the ADC_GetChanValue method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. with 0.393V appied to ADC Channel 3 and using the above code I receive 140 counts of 1023. Using the GetChanValue method i receive 93 counts of 1023. Does the ADC bean have something addtitional to correct for error? (I have both beans configured long sample 10-bit right justified results, in the ADC bean I am using 2 samples setting and in Init_ADC method I am software averaging later in the code like:&lt;/P&gt;&lt;P&gt;reading0 += ReadADC(0);&lt;/P&gt;&lt;P&gt;reading0 /= 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reading1 += ReadADC(1);&lt;/P&gt;&lt;P&gt;reading1 /= 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2014 23:02:36 GMT</pubDate>
    <dc:creator>alexit</dc:creator>
    <dc:date>2014-09-11T23:02:36Z</dc:date>
    <item>
      <title>Continuous ADC</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379821#M21221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using continuous conversion mode for ADC to convert one pin and the internal temperature sensor on a QD4. The PE bean is set for prescaler 8, long sample, with 10-bit right format. The code I am attempting within my Main loop is:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;STRONG&gt;ReadADC&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; channel)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;TWREG tmpTwreg;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;(channel == 0) &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* ADC Pin 3 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;{ADCSC1 = 0x03U;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;else&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; (channel == 1) &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* Internal TempSensor */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;{ADCSC1 = 0x1AU;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;if&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; (ADCSC1_COCO == 1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;tmpTwreg.b&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;high&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = ADCRH;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;tmpTwreg.b&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;low&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = ADCRL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;return&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;word&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)((tmpTwreg.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;w&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;&amp;lt; 5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;}&lt;BR /&gt;This gives me no results, why is continuous mode not providing data to ADCRH and ADCRL?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks, D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2014 18:48:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379821#M21221</guid>
      <dc:creator>alexit</dc:creator>
      <dc:date>2014-08-25T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous ADC</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379822#M21222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Ok, I found the first issue, typo in channel call:&lt;/P&gt;&lt;P&gt;ReadADC(&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; channel)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;TWREG tmpTwreg;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 10pt;"&gt;(channel == 0) &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* ADC Pin 3 */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;{ADCSC1&lt;STRONG&gt;_ADCH&lt;/STRONG&gt;= 0x03U;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;else&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;if&lt;SPAN style="font-size: 10pt;"&gt; (channel == 1) &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;/* Internal TempSensor */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;{ADCSC1&lt;STRONG&gt;_ADCH&lt;/STRONG&gt; = 0x1AU;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 10pt;"&gt; (ADCSC1_COCO == 1) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;tmpTwreg.b&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;high&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = ADCRH;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;tmpTwreg.b&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;low&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = ADCRL;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;return&lt;SPAN style="font-size: 10pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;word&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)((tmpTwreg.&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0; font-size: 10pt;"&gt;w&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &amp;lt;&amp;lt; 5);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Second issue is this returns a value that is offset from the GetChanValue(). Its providing a value almost 50% higher for a given input. Do I need to call a calibration before using this?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 18:40:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379822#M21222</guid>
      <dc:creator>alexit</dc:creator>
      <dc:date>2014-09-11T18:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous ADC</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379823#M21223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;Please check the application note &lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN3031.pdf"&gt;AN3031&lt;/A&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Vicente&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 21:55:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379823#M21223</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2014-09-11T21:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous ADC</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379824#M21224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry I was not clear in my earlier post, all ADC channels are measuring with an offset (not just temp sensor) with the Init_ADC bean in continuous mode compared to the ADC_GetChanValue method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. with 0.393V appied to ADC Channel 3 and using the above code I receive 140 counts of 1023. Using the GetChanValue method i receive 93 counts of 1023. Does the ADC bean have something addtitional to correct for error? (I have both beans configured long sample 10-bit right justified results, in the ADC bean I am using 2 samples setting and in Init_ADC method I am software averaging later in the code like:&lt;/P&gt;&lt;P&gt;reading0 += ReadADC(0);&lt;/P&gt;&lt;P&gt;reading0 /= 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reading1 += ReadADC(1);&lt;/P&gt;&lt;P&gt;reading1 /= 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 23:02:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Continuous-ADC/m-p/379824#M21224</guid>
      <dc:creator>alexit</dc:creator>
      <dc:date>2014-09-11T23:02:36Z</dc:date>
    </item>
  </channel>
</rss>

