<?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: MC9S12XDT512 A2D Converter in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144117#M3686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks, I cant try it till monday but i'll give it a go then and i'll let you know the result.&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Feb 2007 11:18:35 GMT</pubDate>
    <dc:creator>gmorton3</dc:creator>
    <dc:date>2007-02-03T11:18:35Z</dc:date>
    <item>
      <title>MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144113#M3682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi im using the following initiaization for a single channel conversion 8 bit conversion on AN0. I have a 0-5v reference voltage and an input that lies between this range.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;im using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void A2Dsetup (void){&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL2_ADPU = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL2_AFFC = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL2_ASCIE = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL3_FIFO = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_SRES8 = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_SMP1 = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_SMP0 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_PRS4 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_PRS3 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_PRS2 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_PRS1 = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL4_PRS0 = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im also using&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;int res;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;int getTemperatures(void){&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ATD0CTL5 = 0x00;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (ATD0CTL2_ASCIF == 0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;res = (int) ATD0DR1H;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return res;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using The debugger in CodeWarrior i have noticed that the program runs till the "while (ATD0CTL2_ASCIF == 0)" It never moves beyond this point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas what im doing wrong or ideas for how i can get it to work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to anyone who has any ideas!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 01:52:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144113#M3682</guid>
      <dc:creator>gmorton3</dc:creator>
      <dc:date>2007-02-01T01:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144114#M3683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Sorry i should have made this clearer.&amp;nbsp; I only used the debugger to see where the program trips up.&amp;nbsp; It doesnt work when run in hardware.&amp;nbsp; I used an LED switching&amp;nbsp;both sides of&amp;nbsp;the while loop to try and highlight where the code fails and sure enough the led is on before the while loop and never turns off after it.&amp;nbsp; This indicates that the while loop is where im getting tripped up.&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2007 18:34:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144114#M3683</guid>
      <dc:creator>gmorton3</dc:creator>
      <dc:date>2007-02-01T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144115#M3684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;// ATD block set up.&lt;BR /&gt;ATD0CTL2 = 0x80; // Enable power up mode for ADC Block&lt;BR /&gt;ATD0CTL3 = 0x40; // Set 8 bit conversions.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//===============================================================================&lt;BR /&gt;// Trigger, wait, then read a channel and return 8-bit value..&lt;BR /&gt;//===============================================================================&lt;BR /&gt;byte ReadADC(byte channel)&lt;BR /&gt;{&lt;BR /&gt;byte status;&lt;BR /&gt;&lt;BR /&gt;// This resets the conversion done flag and starts a new conversion.&lt;BR /&gt;ATD0CTL5 = SINGLE_MODE+NO_SCAN_MODE+channel;&lt;BR /&gt;&lt;BR /&gt;for ( ; ; )&lt;BR /&gt;{&lt;BR /&gt;status = ATD0STAT0;&lt;BR /&gt;if( status &amp;amp; SCF )&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;status = ATD0DR7H; // Just the hi byte. Ignore LSB's&lt;BR /&gt;ADTValue = status;&lt;BR /&gt;&lt;BR /&gt;return status;&lt;BR /&gt;&lt;BR /&gt;}&lt;P&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2007-02-02&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;06:03 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2007-02-02&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;06:04 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Feb 2007 07:00:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144115#M3684</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2007-02-03T07:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144116#M3685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Sorry -&lt;BR /&gt;SINGLE_MODE NO_SCAN_MODE are both 0&lt;BR /&gt;#define SCF 0x80 //Sequence Complete Flag in ATD0STAT0&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Feb 2007 07:52:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144116#M3685</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2007-02-03T07:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144117#M3686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks, I cant try it till monday but i'll give it a go then and i'll let you know the result.&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Feb 2007 11:18:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144117#M3686</guid>
      <dc:creator>gmorton3</dc:creator>
      <dc:date>2007-02-03T11:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XDT512 A2D Converter</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144118#M3687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Ok a quick update.&amp;nbsp; Got the A2D working and converting as expected.&amp;nbsp; Didnt really make too many changes to the set-up already being used but changed the while loop to look at ATD0STAT0_SCF and that seems to be more successfull.&amp;nbsp; Thanks for the suggestions JimDon.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2007 22:17:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XDT512-A2D-Converter/m-p/144118#M3687</guid>
      <dc:creator>gmorton3</dc:creator>
      <dc:date>2007-02-05T22:17:28Z</dc:date>
    </item>
  </channel>
</rss>

