6 Replies Latest reply on May 17, 2017 3:58 AM by ashok.shenoy

    ADC Single Sample mode funny behaviour

    ashok.shenoy

      Hi,

         

      I am trying to work with Sigma-Delta ADC in single-sample mode for 16 bit in PSoC 5. I am testing my ADC by feeding it with 20Hz sine wave. This sine wave is generated by waveform DAC.

         

      For 60 samples at sampling interval of 5 milli-sec about 6 peaks are expected from the ADC output [(60 *5ms)/50ms =6]. However I see 9 peaks when the raw ADC samples are plotted. I have attached the screenshot of the same.

         

      Note :- I have checked the waveform DAC on the oscilloscope and 20Hz was observed.

         

      Am I doing something wrong here ?

         

      I am also attaching the project bundle.

         

      My main.c looks something like this:

         

      #define NO_SAMPLES 60
      #define SAMPLING_INTERVAL_MS 5
      #include <project.h>
      #include<ADC_DelSig_1.h>

         

      uint8 count=0;
      int32 samples[NO_SAMPLES];

         

      int main()
      {
          
          CyGlobalIntEnable; /* Enable global interrupts. */
          WaveDAC8_1_Start();
          ADC_DelSig_1_Start();

         

          /* Place your initialization/startup code here (e.g. MyInst_Start()) */
          
          for(count =0; count<NO_SAMPLES;count++)
          {
              ADC_DelSig_1_StartConvert();
              if(ADC_DelSig_1_IsEndConversion(ADC_DelSig_1_WAIT_FOR_RESULT)!=0)
              {
                  samples[count]=ADC_DelSig_1_GetResult32();
              }
              ADC_DelSig_1_StopConvert();
              CyDelay(SAMPLING_INTERVAL_MS);
          }   

         

      }