<?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>8-bit Microcontrollers中的主题 Re: ADC problem with MC9S08GB32</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136337#M4310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Jürgen,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ADC conversion errors are always (in my experience) explained by one of&amp;nbsp;3 causes:&lt;/DIV&gt;&lt;DIV&gt;1) you have too much source impedence in the analog network connected to the ADC input. This large impedance makes the charge-transfer onto the internal sample capacitor too slow, so the ADC reads incorrectly. This is detailed in the ADCRM - ADC Reference Manual, just do a keyword search for ADCRM on our site.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2) Incorrect ADC prescaler clock settings in the ATDC_PRS bits. 0xC2 for a 8MHz crystal????? ICGC1 = 0x70 means FBE clock mode, so ICGOUT is 4MHz, and the bus clock is 2MHz.. If you aim for a 1MHz ADC clock, then you need a prescaler of 2, so from the table 14-4 in the datasheet, PRS needs to be 0b0000.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3) You mixed up 8 and 10-bit mode, and confused right or left justified, so the chip is reading right, but you incorrectly read the result registers.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Post to us on this forum and let us know how you get on,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mark&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 May 2006 04:38:51 GMT</pubDate>
    <dc:creator>UK_CF_FAE</dc:creator>
    <dc:date>2006-05-18T04:38:51Z</dc:date>
    <item>
      <title>ADC problem with MC9S08GB32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136336#M4309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some problems with the ADC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The conversion seems to work fine. I get IRQs but the values are wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use 10bit resolution the values are from 970 to 1007 depending on the supplied voltage at the ad pin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My board configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;external XTAL 8MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Register:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ICGC1 = 0x70&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADTC1 = 0xC2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD1PE = 0x1F&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;start with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD1SC = ATDIE | channel_no&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps anyone has an idea what could be wrong....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jürgen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2006 22:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136336#M4309</guid>
      <dc:creator>unclejay</dc:creator>
      <dc:date>2006-05-17T22:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: ADC problem with MC9S08GB32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136337#M4310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Jürgen,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ADC conversion errors are always (in my experience) explained by one of&amp;nbsp;3 causes:&lt;/DIV&gt;&lt;DIV&gt;1) you have too much source impedence in the analog network connected to the ADC input. This large impedance makes the charge-transfer onto the internal sample capacitor too slow, so the ADC reads incorrectly. This is detailed in the ADCRM - ADC Reference Manual, just do a keyword search for ADCRM on our site.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2) Incorrect ADC prescaler clock settings in the ATDC_PRS bits. 0xC2 for a 8MHz crystal????? ICGC1 = 0x70 means FBE clock mode, so ICGOUT is 4MHz, and the bus clock is 2MHz.. If you aim for a 1MHz ADC clock, then you need a prescaler of 2, so from the table 14-4 in the datasheet, PRS needs to be 0b0000.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3) You mixed up 8 and 10-bit mode, and confused right or left justified, so the chip is reading right, but you incorrectly read the result registers.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Post to us on this forum and let us know how you get on,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mark&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2006 04:38:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136337#M4310</guid>
      <dc:creator>UK_CF_FAE</dc:creator>
      <dc:date>2006-05-18T04:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: ADC problem with MC9S08GB32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136338#M4311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello Mark,&lt;BR /&gt;&lt;BR /&gt;first thanks for your answer.&lt;BR /&gt;&lt;BR /&gt;1.) Even when I connect ground to the ad input pin I get 970 as the conversion result.&lt;BR /&gt;&lt;BR /&gt;2.) I have corrected the values. My bus clock is 8 Mhz ( ICGC1 = 0x78 /&lt;BR /&gt;ICGC2 = 0x01) and ADC PRS is set to 2 (factor 6). So the conversion clock is 1,33MHz.&lt;BR /&gt;&lt;BR /&gt;3.) The justify and mode settings are correct. For debug I have also checked the values in the result registers. Which also never reach the value 0.&lt;BR /&gt;&lt;BR /&gt;Jürgen&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2006 15:57:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136338#M4311</guid>
      <dc:creator>unclejay</dc:creator>
      <dc:date>2006-05-18T15:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: ADC problem with MC9S08GB32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136339#M4312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The Problem was solved.... the µC was broken.&lt;BR /&gt;&lt;BR /&gt;Thanks...&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2006 16:54:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/ADC-problem-with-MC9S08GB32/m-p/136339#M4312</guid>
      <dc:creator>unclejay</dc:creator>
      <dc:date>2006-05-18T16:54:43Z</dc:date>
    </item>
  </channel>
</rss>

