cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

New Contributor II

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

0 Likes
Reply
7 Replies
Anonymous
Not applicable

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.

0 Likes
Reply
New Contributor II

> 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

0 Likes
Reply
Anonymous
Not applicable

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

0 Likes
Reply
New Contributor II

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

0 Likes
Reply
Anonymous
Not applicable

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

0 Likes
Reply
Anonymous
Not applicable

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.

0 Likes
Reply
New Contributor II

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

0 Likes
Reply