<?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>S12 / MagniV MicrocontrollersのトピックIn 9s12g128 chipset,how to select pad0 IO function?Since that PAD/AN0 is one pin.</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/In-9s12g128-chipset-how-to-select-pad0-IO-function-Since-that/m-p/392774#M10913</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how to select PAD0 function and I don't know how to select AN0 function.Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 May 2015 15:02:57 GMT</pubDate>
    <dc:creator>100asong</dc:creator>
    <dc:date>2015-05-24T15:02:57Z</dc:date>
    <item>
      <title>In 9s12g128 chipset,how to select pad0 IO function?Since that PAD/AN0 is one pin.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/In-9s12g128-chipset-how-to-select-pad0-IO-function-Since-that/m-p/392774#M10913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how to select PAD0 function and I don't know how to select AN0 function.Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 May 2015 15:02:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/In-9s12g128-chipset-how-to-select-pad0-IO-function-Since-that/m-p/392774#M10913</guid>
      <dc:creator>100asong</dc:creator>
      <dc:date>2015-05-24T15:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: In 9s12g128 chipset,how to select pad0 IO function?Since that PAD/AN0 is one pin.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/In-9s12g128-chipset-how-to-select-pad0-IO-function-Since-that/m-p/392775#M10914</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;The primary function of PAD/AN0 pin is GPIO. So if you do not use ATD's AN0 channel, then it can be used as GPIO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 6 ATD control registers (ATDCTL0-5). The ATDCTL5 register's bits 0-3 (CD,CC,CB and CA) are used to select analog input channel. See &lt;A href="http://cache.freescale.com/files/32bit/doc/ref_manual/MC9S12GRMV1.pdf"&gt;&lt;SPAN class="l"&gt;&lt;SPAN class="goog-trans-section l"&gt;MC9S12GRMV1, MC9S12G Family Reference Manual and Data Sheet&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN class="toggle-preview"&gt;&lt;/SPAN&gt; and Table 11-14. ATDCTL5 Field Descriptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that analog function of the pin is active when ATD is active. After you configure the ADC by writing to ATD control register, the conversion starts with write to ATDCTL5 register, so this one should be configured last.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, an ATD input pin has General-Purpose Digital Port Operation.&lt;/P&gt;&lt;P&gt;Each ATD input pin can be switched between analog or digital input functionality.&lt;/P&gt;&lt;P&gt;The pad of the ATD input pin is always connected to the analog input channel of the analog mulitplexer.&lt;/P&gt;&lt;P&gt;Also, each pad input signal is buffered to the digital port register. This buffer can be turned on or off with the ATDDIEN register for each ATD input pin.&lt;/P&gt;&lt;P&gt;Below is a code snippet of ATD digital port operation:&lt;/P&gt;&lt;P&gt;###########################################&lt;/P&gt;&lt;P&gt;int my_variable @0x01000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DDR1AD_DDR1AD4=1;&amp;nbsp; //associated pin configured as input&lt;/P&gt;&lt;P&gt; PER1AD_PER1AD4=1;&amp;nbsp; //pull enable;&lt;/P&gt;&lt;P&gt; PPS1AD_PPS1AD4=1;&amp;nbsp; //pull down.&lt;/P&gt;&lt;P&gt; ATDDIEN_IEN4=1;//digital input enabled&lt;/P&gt;&lt;P&gt; PT1AD_PT1AD4=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; EnableInterrupts;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; my_variable = 10;&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;_FEED_COP(); /* feeds the dog */&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; } /* loop forever */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* please make sure that you never leave main */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;###########################################&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 10:08:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/In-9s12g128-chipset-how-to-select-pad0-IO-function-Since-that/m-p/392775#M10914</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2015-05-27T10:08:44Z</dc:date>
    </item>
  </channel>
</rss>

