7 Replies Latest reply on Sep 18, 2010 9:09 AM by HuEl_264296

    Exact ADC sample point?

    HuEl_264296

      Hi,

         

      I want to use a PSoC3 to measure the average current through an inductor, which is being driven by a center-aligned PWM from the PSoC. Therefore I need to make sure the sample point of the ADC coincides exactly with the center of the PWM pulse.

         

      Is it enough simply to wire the PWM tc output to the ADC soc input? Does the sample and hold happen on the rising edge of soc?

         

       

         

      Many thanks

         

      Hugo Elias  -  Shadow Robot Co Ltd

        • 1. Re: Exact ADC sample point?

          soc – Input *
          The Start of Conversion (soc) is an optional pin. It is shown if you have selected to use hardware
          to trigger a start of conversion. A rising edge on this pin will start an ADC conversion if the option
          is selected. If the Start of Conversion parameter is set to "Software" this I/O will be hidden.
          Rising endge on the SOC pin will start a conversion.

          • 2. Re: Exact ADC sample point?
            HuEl_264296

            > Rising endge on the SOC pin will start a conversion.

               

            Thanks, I understand that. What I want to know is exactly when the input voltage is taken by the track and hold circuit (assuming there is one). This is critically important for rapidly changing signals.

               

            Hugo

            • 3. Re: Exact ADC sample point?

              S&H circuit is able to track acc. to nyquist frequency.

                 

              S&H point  is of minor importance, because You try to catch higher frequencies the S&H can withstand.

                 

              The result is that You will see things which don't exist in realtime.

                 

              robert

              • 4. Re: Exact ADC sample point?
                HuEl_264296

                No, the exact ADC sample point is critical.

                   

                 

                   

                I'm measuring the sawtooth wave caused by current measurement of PWM through a motor. It's critical that the sample point is exactly at the centre of the on pulse, so that the average current can accurately be measured.

                   

                 

                   

                Any offset in the time will create an offset in my reading. Any jitter in the time will create noise.

                   

                 

                   

                The sample rate will be the same as the PWM frequency, which is fine because I don't need to know the exact shape of the wave.

                   

                 

                   

                Hugo

                • 5. Re: Exact ADC sample point?

                  You need sample time at least 2 times the PWM. The only way is to restore full wave and average by software.

                     

                  Other solution is to use comparator and counter.

                     

                  regards

                     

                  robert

                  • 6. Re: Exact ADC sample point?

                    Well, you could always sample the Sawtooth once at the rising edge of your PWM and once at the falling edge. Then estimate your midpoint sawtooth voltage by linearization.

                       

                    Imran.

                    • 7. Re: Exact ADC sample point?
                      HuEl_264296

                      That still doesn't help if I still don't know exactly when the sample happens.