<?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: QG8 suggestion</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177713#M12561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mac&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I wrote this code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void Init_ADC(void){  ADCSC1_ADCH = 0x1f; // all channels selected disables the ADC during config    ADCCFG_ADICLK = 0b01;  // clock source, 00=bus clock, 11 = async. clock,01=bus/2   ADCCFG_MODE = 0b00; // conversion mode, 00 = 8 bit, 10 = 10 bit mode  ADCCFG_ADLSMP = 1;  // sample time, 1 = long sample time  ADCCFG_ADIV = 0b11;    // clock divide, 11 = input clock/8  ADCCFG_ADLPC = 1;  // low power config, 1 = low power   ADCSC2_ADTRG = 0;   // trigger select, 0 = software trigger  ADCSC2_ACFE = 0;    // compare function, 1 = enable compare function  //ADCSC2_ACFGT = 1;   // 1 = compare function greater than    ADCSC1_ADCO = 0;    // enable single conversion, 1 is continuous conversion  ADCSC1_AIEN = 1;    // enable ADC interrupt  APCTL1_ADPC2 = 1;   // disable I/O control on pin      //ADCCVL = 255;      // set a compare value         ADCSC1_ADCH = 0x02;   //ADP2 enable  }//-------------------------------------------------------------------------------------interrupt 19 void ADC_ISR(void)   {    ADC_Read=ADCRL;  //Acknowledge the Read Value to disable COCO Flag    if ( ADC_Read&amp;gt;=(unsigned char)90)     {        PTAD_PTAD1 = RESET;     //reset Relay     PTBD_PTBD1 = SET  ;     //red LED on          while(1); //wait here until reset  }     if ( ADC_Read&amp;lt;=(unsigned char)50)     {     PTAD_PTAD1 = RESET;     //reset Relay     PTBD_PTBD0 = SET  ;     //green LED on     while(1);  }      ADCSC1_ADCO = 0;    // enable single conversion, 1 is continuous conversion   ADC_Read=0;  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But the ADC_ISR is invoked all the time.The relay is reset always.&lt;/P&gt;&lt;P&gt;Now when I remove the &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
ADCSC1_ADCO = 0;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and put in main( ) where there's a 'forever' loop, the ADC interrupt isn't invoked and no action takes place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;What might be wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks and regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:26:46 GMT</pubDate>
    <dc:creator>abicash</dc:creator>
    <dc:date>2020-10-29T09:26:46Z</dc:date>
    <item>
      <title>QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177704#M12552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)I am using the ADC on QG8 in 8 bit mode and continous compare to interrupt when a certain value to the input is above the set value in ADCCVL.&lt;/P&gt;&lt;P&gt;I now want a window comparator where I want to monitor an ADC i/p of less than some set value.How can I do this since QG8 has either a higher than or lesser than compare value (ACFGT).&lt;/P&gt;&lt;P&gt;Further I had a problem while using the 'higher than' setting.I am using a CT (current transformer) to measure a current value and the secondary side is rectified and filtered and fed to the ADC i/p.Even if I set the ADCCVl at 0xFF,so that the voltage at which it interrupts is 3.3V,it gives an interrupt for a voltage drop of 2V.To aggravate it also interrupts for a very small load because of the current surge.How can I take care of this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)In the same circuit I am powering the QG8 and related ckt using an unisolated Power supply.(The mains is not stepped down with a transformer)The neutral on mains and the ckt ground are common.&lt;/P&gt;&lt;P&gt;I also drive a relay with one of the GPIO on the QG8.&lt;/P&gt;&lt;P&gt;Whenever I run the code on a battery generated 5V(or the debugger),the code executes flawlessly.&lt;/P&gt;&lt;P&gt;But when the unisolated PSU is connected,the noise starts working into the MCU.I have heavily filtered the&amp;nbsp; key points on the board,but still the problem continues.&lt;/P&gt;&lt;P&gt;It is further aggravated when the relay switches with some load.The EMI/EMC on the contacts of the relay make the MCU misbehave and it jumps to unknown routines.&lt;/P&gt;&lt;P&gt;How immune is the QG8 to this kind of noise?&lt;/P&gt;&lt;P&gt;Has anyone worked on this kind of setup before?....The same kind of setup is used in washing machines and it works nicely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please someone help....and thank you for reading this long post &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif"&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2009 13:46:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177704#M12552</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-02T13:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177705#M12553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved the noise problem by using RC snubbers on the relay.&lt;/P&gt;&lt;P&gt;I am still working on the window comparator with the ADC&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If someone can direct me to a simple approach...that would be wonderful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 18:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177705#M12553</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-05T18:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177706#M12554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Abi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that you are squuezing too much on a hardware sollution. Probably you'll get better results if you sample the signal - you could use CW to sample it N times and extract average value - and write your own software handler for this situation involving surge and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you are dealing w/ commercial AC maybe you could set a timer to 1KHz rate, call the CW analog measurement functions and maybe use a state-machine based function to implement your handler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:42:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177706#M12554</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2009-05-05T19:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177707#M12555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello celsoken&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for the reply&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is CW?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the ignorance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from that I got the idea...thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please also guide me towards the window comparison approach&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 20:26:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177707#M12555</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-05T20:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177708#M12556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Abi, sorry, CW stands for CodeWarrior, I meant that you could use CW built-in functions to read the ADC and extract average value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding guiding you, I could try to answer your questions, ok?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 20:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177708#M12556</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2009-05-05T20:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177709#M12557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello celsoken&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for replying&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok I got the idea.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my ckt ,I have measure a value corresponding to a current.If the current is above a value then a GPIO pin should be pulled low and the MCU just waits there --no action.It comes out of that wait only on a hardware reset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the current is below a threshold value,the GPIO pin is again pulled low but the MCU doesnt wait for a RESET.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Earlier the requirement was for current-above-reset and that was done using a ACFGT=1 and a finite ADCCVL=0x(some value)..but this current-low is thrown in now,and since there are numerous approaches to this,I was lookin out for a fairly simple approach..&amp;nbsp;&lt;/P&gt;&lt;P&gt;The accuracy is not that important (since I am measuring mains curent through a CT) I am using 8bit resolution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me if you can&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 20:55:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177709#M12557</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-05T20:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177710#M12558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Abi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want a simple approach, why don't you use a classical two-comparator hardware sollution. If you don't wanna spend extra in hardware, use the QG8 internal comp for the higher limit and an external discrete comparator for the lower limit. Some mickey-mouse logic will save you some pennies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise there is the software sollution wich will take you some implementing time. Probably much better but it will take time...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177710#M12558</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2009-05-05T21:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177711#M12559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello celsoken&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me about the software approach?...some algorithm?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regrds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 21:40:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177711#M12559</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-05T21:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177712#M12560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternative method might be considered that uses single conversion mode, rather than continuous conversion.&amp;nbsp; Enable ADC conversion complete interrupt, and initiate the first ADC conversion within the initialisation section of your program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within the ADC ISR, test for both upper and lower threshold limits, and do the required action associated with the particular ADC reading.&amp;nbsp; Then start the next conversion and exit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on how much other background activity needs to occur within your program, you might choose a lower ADC clock frequency, and select the long acquisition period, to provide more cycles for the background activities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 01:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177712#M12560</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-05-06T01:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177713#M12561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mac&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I wrote this code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void Init_ADC(void){  ADCSC1_ADCH = 0x1f; // all channels selected disables the ADC during config    ADCCFG_ADICLK = 0b01;  // clock source, 00=bus clock, 11 = async. clock,01=bus/2   ADCCFG_MODE = 0b00; // conversion mode, 00 = 8 bit, 10 = 10 bit mode  ADCCFG_ADLSMP = 1;  // sample time, 1 = long sample time  ADCCFG_ADIV = 0b11;    // clock divide, 11 = input clock/8  ADCCFG_ADLPC = 1;  // low power config, 1 = low power   ADCSC2_ADTRG = 0;   // trigger select, 0 = software trigger  ADCSC2_ACFE = 0;    // compare function, 1 = enable compare function  //ADCSC2_ACFGT = 1;   // 1 = compare function greater than    ADCSC1_ADCO = 0;    // enable single conversion, 1 is continuous conversion  ADCSC1_AIEN = 1;    // enable ADC interrupt  APCTL1_ADPC2 = 1;   // disable I/O control on pin      //ADCCVL = 255;      // set a compare value         ADCSC1_ADCH = 0x02;   //ADP2 enable  }//-------------------------------------------------------------------------------------interrupt 19 void ADC_ISR(void)   {    ADC_Read=ADCRL;  //Acknowledge the Read Value to disable COCO Flag    if ( ADC_Read&amp;gt;=(unsigned char)90)     {        PTAD_PTAD1 = RESET;     //reset Relay     PTBD_PTBD1 = SET  ;     //red LED on          while(1); //wait here until reset  }     if ( ADC_Read&amp;lt;=(unsigned char)50)     {     PTAD_PTAD1 = RESET;     //reset Relay     PTBD_PTBD0 = SET  ;     //green LED on     while(1);  }      ADCSC1_ADCO = 0;    // enable single conversion, 1 is continuous conversion   ADC_Read=0;  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But the ADC_ISR is invoked all the time.The relay is reset always.&lt;/P&gt;&lt;P&gt;Now when I remove the &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
ADCSC1_ADCO = 0;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and put in main( ) where there's a 'forever' loop, the ADC interrupt isn't invoked and no action takes place.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;What might be wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks and regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177713#M12561</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2020-10-29T09:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177714#M12562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to go a bit further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In debug mode whenever I RUN the code and i switch on a high load &amp;nbsp;,it should go in the ADC_ISR and turn the pin low so that the load is turned off.&lt;/P&gt;&lt;P&gt;But it doesn't do this.When I hit HALT and then again RUN the code does the pin turn low (according to the decision set)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add ,if i run it in STEP mode it acts as it should.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Not able to understand this...&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 19:54:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177714#M12562</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-06T19:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177715#M12563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the problem is that you are writing to ADCSC1 within the ISR, but not stipulating that the conversion requires to be for the ADP2 channel; I suspect that subsequent conversions will occur for ADP0.&amp;nbsp; Since any write to ADCSC1 will start a new conversion, it is important&amp;nbsp; that all bits be written simultaneously, i.e. ADCSC1 = 0x02;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, during the inititialisation, the coding will be simplified if the whole register is written, rather than individual bits, or groups of bits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is the modified code for the ISR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;interrupt 19 void ADC_ISR(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (ADCRL &amp;gt;= 90) {&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTAD_PTAD1 = RESET;&amp;nbsp;&amp;nbsp; //reset Relay&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD1 = SET;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //red LED on&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //wait until reset&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (ADCRL &amp;lt;= 50) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTAD_PTAD1 = RESET;&amp;nbsp;&amp;nbsp; //reset Relay&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD0 = SET;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //green LED on&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ADCSC1 = 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Commence new conversion ADP2 &amp;amp; clear flag&lt;BR /&gt;&lt;/FONT&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the COCO flag will be cleared when a new conversion commences.&amp;nbsp; Also the casts would seem unnecessary.&amp;nbsp; I assume that the out-of-range reset is caused by COP timeout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 02:04:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177715#M12563</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-05-07T02:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177716#M12564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mac&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The funny thing is that it never enters the ADC_ISR with &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
ADCSC1 = 0x02; // Commence new conversion ADP2 &amp;amp; clear flag&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It only enters the ISR 'ONLY' on ADCSC1_ADCO=0;&lt;/P&gt;&amp;nbsp;My ADCCFG (after checking multiple values for clocks and divisors where i thought it might work corerctly) is ADCCFG = 0xb0;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have disabled COP in SOPT so theres no question of COP reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have also added another instruction so that it will poll for COCO flag and then go about doing the stuff in the ISR w/o using interrupt..but the same thing is being repeated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am really out of ideas now..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please provide an insight&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks and regrds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by abicash on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-05-07&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;07:36 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:26:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177716#M12564</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2020-10-29T09:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177717#M12565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mac&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ADCSC1 =0x02 you suggested is missing the AIEN and ADCO, so the ISR is never invoked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if I set these in the ADCSC1=0x62, the code will not go anywhere else other than the ISR.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I cleared the AIEN thus &amp;nbsp;ADCSC1=0x22, and set the AIEN in my main( ) where there's a continuos loop.This repeats my earlier problem (works in debugger).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO no matter how it's setup,it isn't working as it should.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please steer me along...since I am close to breaking down now with this 'seemingly' trivial problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by abicash on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-05-07&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;08:35 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 14:33:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177717#M12565</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-07T14:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177718#M12566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have done some more things here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please have alook at my init and ISR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void Init_ADC(void){     ADCSC1 = 0x3f;// disable all      ADCCFG = 0xe9; //same as above 0b     ADCSC2=0x00;     APCTL1= 0x04;   // disable I/O control on pin       ADCSC1= 0x42 ;    }//-------------------------------------------------------------------------------------interrupt 19 void ADC_ISR(void)   {      ADC_CNT++;            ADC_Read+=ADCR;  //Acknowledge the Read Value to disable COCO Flag  if (ADC_CNT&amp;gt;=10)   {    ADC_Read= ADC_Read/10;           if ( ADC_Read&amp;gt;=350)             {               PTAD_PTAD1 = RESET;     //reset Relay            PTBD_PTBD1 = SET  ;     //red LED on                }         if ((( ADC_Read&amp;lt;=50)) &amp;amp;&amp;amp; (PTAD_PTAD1==1) )          {          PTAD_PTAD1 = RESET;     //reset Relay          PTBD_PTBD0 = SET  ;     //green LED on                 }                  ADC_CNT=0;       ADC_Read =0 ;                  }      ADCSC1_ADCH=0x02;   } void main ( ){     SOME CODE ;for (;;){     SOME CODE;    ADCSC1_ADCO = 0;    // enable single conversion, 1 is continuous  conversion}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The &amp;nbsp;&amp;nbsp;&amp;nbsp; ADCSC1_ADCO = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable single conversion, 1 is continuous conversion&lt;BR /&gt;was earlier in the ADC_ISR but this didn't get me anywhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now with the above code too whenever I run it in step mode the ISR is invoked and the routine is serviced but on RUN it never enters the ISR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What could be wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thaks and regards&lt;/P&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:26:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177718#M12566</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2020-10-29T09:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177719#M12567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ripple on the ADC i/p is substantial.&lt;/P&gt;&lt;P&gt;It is the o/p of a CT which is half wave rectified and filtered (now) with close to 100uF capacitor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will this play some major part...since i think the ADC will sample only an average,according to the code i have written.&lt;/P&gt;&lt;P&gt;Please see the ripple on my oscilloscope attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 22:38:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177719#M12567</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-07T22:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177720#M12568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone please help.I am stuck up here.. &lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 13:44:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177720#M12568</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-08T13:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177721#M12569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please someone can write an ADC initialisation routine for me?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My BUSFREQ = 8MHz&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Especially setting the ADCCFG.Since whichever ADC freq i set (changing ADIV and ADICLK) the ISR is invoked in single step but never in RUN mode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 22:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177721#M12569</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-08T22:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177722#M12570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not a question of the ripple of the CT..since now I checked with a DC voltage through a preset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to get the correct ADC freq.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My BUS freq is 8MHz and i checked ADC freq from 500KHz and above but no joy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wish someone would take interest in my problem and guide me..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 May 2009 14:11:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177722#M12570</guid>
      <dc:creator>abicash</dc:creator>
      <dc:date>2009-05-09T14:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 suggestion</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177723#M12571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Abi.&lt;/P&gt;&lt;P&gt;I have some experience with a circuit similar to yours and I would caution you that you can get erratic behavior from using an un-isolated supply (running directly off the mains).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you connect the debug pod and computer to your board you are also connecting the computer ground to the mains neutral.&amp;nbsp; I broke the usb port on my laptop in just this way.&amp;nbsp; This may explain why you get different operation when running off the dc supply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, as Bigmac said, I think it is a mistake to run the ADC in continuous conversion mode.&amp;nbsp; It complicates your life un-necessarily.&amp;nbsp; I always use use a different timer, such as a heart-beat interrupt, to call an ADC single-conversion module.&amp;nbsp; I stay within the module till I get the result (conversion complete flag set) then run the result thru a filter and leave it in a variable for other processes to use.&lt;/P&gt;&lt;P&gt;ron&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2009 11:24:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-suggestion/m-p/177723#M12571</guid>
      <dc:creator>glork</dc:creator>
      <dc:date>2009-05-14T11:24:40Z</dc:date>
    </item>
  </channel>
</rss>

