7 Replies Latest reply on Apr 28, 2015 2:44 PM by userc_41483

    ADC Pause

       Hello, I am currently using ADCIN and I'm wondering if theres a way to "pause" the ADC for a certain time. Right now I'm setting pins that read from an external mux which sends back to my ADC in two different Channels. I have narrowed it down to most likely reading data too fast.














      Let me know if you need more info

        • 1. Re: ADC Pause

          You can start and stop an adc, but generally, unless there are


          power considerations, I run the ADC continuously, and throw


          away sample(s) if I need settling time.




          The APIs are in the components datasheet to start and stop the


          ADC. Read the fine print on the adc as you may need delay after startup,


          for example flushing the decimator(s).




          When you read ADC there is an API that indicates it has a new sample


          ready. Normally one qualifies the read with this API indicating true, eg.


          that a sample is ready. Look at the example project for the type ADC


          you are using. Or the code sample at bottom of component datasheet.


          Some people do a while() until the api indicates sample is ready, others


          go do other things and come back to check if sample ready.




          Regards, Dana.

          • 2. Re: ADC Pause

             Thank you so much for answering,


            my current way of doing things is 




            /* Start The ADC */








            /* Infinite Loop */


            while (1)




                          //other Code


                           while (ADCINC_1_fIsDataAvailable() == 0);


                    /* Read the ADC Result */










            How would I go about throwing away samples or if data was read too fast. would this have to deal with the Hz at which things are running? (Computer Science Major, Not tons of Electrical Experience).





            • 3. Re: ADC Pause

               Or I may be looking for something like an interrupt for 10ms for example after I switch channels and set ports which is before Reading the ADC.

              • 4. Re: ADC Pause

                To throw away n samples do a while loop capturing


                n conversions and exit, last conversion the answer.




                Something like this -


                i = 3


                     while( i > 0 ) {


                         while(ADC12BIT_fIsDataAvailable() == 0);                                           // Loop until value ready
                         iAtod_val = ADC12BIT_iClearFlagGetData ();                                         // Get settled ADC result








                The above will capture the 3'rd sample in iAtod_val;


                Regards, Dana.

                • 5. Re: ADC Pause

                  Edit: This post was accidental

                  • 6. Re: ADC Pause

                     Thank you for the help with ADC setteling, My question expands from this and I decided to make a new post about how I should set up my frequencies



                    • 7. Re: ADC Pause

                      Glad to have been of assistance.




                      Regards, Dana.