<?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のトピックRe: How to initialize the ADC into continuous conversion mode?</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960482#M16753</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;Your initialization is working, try adding adc_result to Variables tab in debugger, enable continuous refresh and run. I see values&amp;nbsp;changing&amp;nbsp;as you turn potentiometer.&amp;nbsp;Perhaps something is wrong in the way you observe my_result, compiler optimization or something odd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jun 2019 18:31:11 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2019-06-07T18:31:11Z</dc:date>
    <item>
      <title>How to initialize the ADC into continuous conversion mode?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960481#M16752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have met some problem when using&amp;nbsp;ADC12B_LBA_V1 module on the&amp;nbsp;MC&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;9S12ZVC192(64 pin).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;The hardware I use is the NXP official DEVKIT-S12ZVC board.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;I want to use the ADC module in continuous conversion mode like the reference manual says:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;Applications that only need to continuously convert a list of channels, without the need for timing control&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;or the ability to perform different sequences of conversions (grouped number of different channels to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;convert) can make use of the following simple setup:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;• “Trigger Mode” configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;• Single buffer CSL&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;• Depending on data transfer rate either use single or double buffer RVL configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;• Define a list of conversion commands which only contains the “End Of List” command with&amp;nbsp;&lt;/SPAN&gt;automatic wrap to top of CSL&lt;/P&gt;&lt;P&gt;After finishing the configuration and enabling the ADC an initial Restart Event is sufficient to launch the&lt;/P&gt;&lt;P&gt;continuous conversion until next device reset or low power mode&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;so I initial the ADC module in this way:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;volatile u32 __attribute__ ((aligned (4))) adc0_cmdlist[2] = {&lt;BR /&gt; 0x00D04000UL,&lt;BR /&gt; 0x80D14000UL};&lt;BR /&gt;volatile u16 __attribute__ ((aligned (4))) adc0_results[16]={&lt;BR /&gt; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};&lt;BR /&gt;void ADC_init(void){&lt;BR /&gt; u16 tmp;&lt;BR /&gt; ADC0CTL_0 = 0x0D; /*Dual Access mode and trigger mode selected */&lt;BR /&gt; ADC0CTL_1 = 0x00; /* Single command and result value list */&lt;BR /&gt; ADC0TIM = 0x07; /* &amp;nbsp;prescaler selected \*/&lt;BR /&gt; ADC0FMT = 0x82; /*Right&amp;nbsp;justified and 10 bit resolution*/&lt;/P&gt;&lt;P&gt;/* ADC0 Command &amp;amp; Result Base Pointers */&lt;BR /&gt; ADC0CBP_0 = (unsigned char)(((long)adc0_cmdlist) &amp;gt;&amp;gt; 16);&lt;BR /&gt; ADC0CBP_1 = (unsigned char)(((long)adc0_cmdlist) &amp;gt;&amp;gt; 8);&lt;BR /&gt; ADC0CBP_2 = (unsigned char)((long)adc0_cmdlist);&lt;/P&gt;&lt;P&gt;// ADC0 Result Base Pointer&lt;BR /&gt; ADC0RBP_0 = (unsigned char)(((long)adc0_results) &amp;gt;&amp;gt; 16); &lt;BR /&gt; ADC0RBP_1 = (unsigned char)(((long)adc0_results) &amp;gt;&amp;gt; 8);&lt;BR /&gt; ADC0RBP_2 = (unsigned char)((long)adc0_results);&lt;BR /&gt; ADC0CTL_0_ADC_EN= 1;/* Enables the ADC*/ &lt;BR /&gt; for(tmp=0;tmp&amp;lt;10000;tmp++){} &lt;BR /&gt; ADC0FLWCTL_RSTA=1;&lt;BR /&gt; for(tmp=0;tmp&amp;lt;10000;tmp++){}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff; font-size: 16px;"&gt;When I try to periodically read the conversion result &amp;nbsp;of AN1&amp;nbsp;by 'my_result=&lt;SPAN style="color: #3d3d3d;"&gt;adc0_results[1]', I found that the value does not change at all although I have changed the position of the potentiometer on the&amp;nbsp;&lt;SPAN style="color: #4a4a4d; background-color: #ffffff;"&gt;DEVKIT-S12ZVC board which is linked to the AN1.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4a4a4d; font-size: 16px; "&gt;Since I think it is initialized into the continuous conversion mode, I do not give one more trigger or restart event after initialization and directly read the conversion result per 10 ms:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4a4a4d; font-size: 16px; "&gt;void TenmsInt(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;my_result&lt;/SPAN&gt; = adc0_results[1];&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4a4a4d; font-size: 16px; "&gt;So anyone can help me to figure out where is the problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2019 12:37:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960481#M16752</guid>
      <dc:creator>thulzh</dc:creator>
      <dc:date>2019-06-07T12:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the ADC into continuous conversion mode?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960482#M16753</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;Your initialization is working, try adding adc_result to Variables tab in debugger, enable continuous refresh and run. I see values&amp;nbsp;changing&amp;nbsp;as you turn potentiometer.&amp;nbsp;Perhaps something is wrong in the way you observe my_result, compiler optimization or something odd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2019 18:31:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960482#M16753</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-06-07T18:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the ADC into continuous conversion mode?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960483#M16754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I have added the adc_result[] to Variables tab in debugger, enable contious refresh and run.&amp;nbsp;The&amp;nbsp;&lt;SPAN&gt;adc_result[1] did not change but stay silent at the value which I think it to be the cooresponding value of the very beginning position of &amp;nbsp;&lt;/SPAN&gt;potentiometer. It seems that the ADC has converted once at the beginning.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jun 2019 03:26:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960483#M16754</guid>
      <dc:creator>thulzh</dc:creator>
      <dc:date>2019-06-09T03:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the ADC into continuous conversion mode?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960484#M16755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have try another way and it worked. The result changed as I turn&amp;nbsp;potentiometer.&lt;/P&gt;&lt;P&gt;1.volatile u32 __attribute__ ((aligned (4))) adc0_cmdlist[2] = {&lt;BR /&gt; 0x00D04000UL,&lt;BR /&gt; 0xC0D14000UL &lt;STRONG&gt;// change the CMD_SEL from 2'b 10 to 2'b 11, the previous one is 0x80D14000UL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;2. u16 tmp;&lt;BR /&gt; ADC0FLWCTL_RSTA=1;&lt;BR /&gt; for(tmp=0;tmp&amp;lt;10000;tmp++){} &lt;STRONG&gt;//give a restart even before read the results&lt;/STRONG&gt;&lt;BR /&gt;my_result = 50*adc0_results[1];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does&amp;nbsp;this attempt provide some useful information for analyzing the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jun 2019 03:37:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960484#M16755</guid>
      <dc:creator>thulzh</dc:creator>
      <dc:date>2019-06-09T03:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to initialize the ADC into continuous conversion mode?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960485#M16756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;0x80D14000UL&lt;/STRONG&gt; is correct.&lt;/P&gt;&lt;P&gt;You code from your first message works on my DEVKIT-&lt;SPAN style="color: #4a4a4d;"&gt;S12ZVC, adc0_results update as I turn potentiometer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2019 07:49:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-initialize-the-ADC-into-continuous-conversion-mode/m-p/960485#M16756</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-06-10T07:49:32Z</dc:date>
    </item>
  </channel>
</rss>

