8 Replies Latest reply on Feb 27, 2015 9:36 AM by DaKn_263916

# Is it possible to read sine wave at the input of PSOC 5?

Hello everyone,

till now i have read dc signal with ADC, but i don´t know how i can read a sine wave.

Thanks for any help

Regards

Claire

• ###### 1. Re: Is it possible to read sine wave at the input of PSOC 5?

Yes, but you have to level shift sine so that it meets following

condition (A/D buffer bypassed to give R-R CM Range ) -

Vdda + 100mV >= Vsine >= Vssa - 100 mV

Simple offset methods attached.

Regards, Dana.

• ###### 2. Re: Is it possible to read sine wave at the input of PSOC 5?

Hello Dana,

Thanks

Regards

Rosine

• ###### 3. Re: Is it possible to read sine wave at the input of PSOC 5?

Just look at the ADC sample projects. (Open the component tree, right-click on the DelSigADC). E.g. the ADC-DMA project is interesting.

For level shifting, see these 2 discussions: http://www.cypress.com/?app=forum&id=2233&rID=70286 and http://www.cypress.com/?app=forum&id=2233&rID=66845 .

What do you want to do with the sine wave data you have read via the ADC?

• ###### 4. Re: Is it possible to read sine wave at the input of PSOC 5?

The two resistor level shift approach is shown in the edn article

in the zip file I posted. Pretty simple and obvious. This allows

DC coupling. This approach another way but is AC coupled -

If you are trying to digitize the sine just meet nyquist for your max freq allowed,

which raises the question(s) -

1) What is min and max sinewave freq in ?

2) Are you trying to digitize sine or measure its properties, like pk-pk, rms, frequency, period,

crosover.......

3) Any measurement latency concerns ?

Regards, Dana.

• ###### 5. Re: Is it possible to read sine wave at the input of PSOC 5?

Hello Hli,

i would like to change the duty cycle of the PWM based on the value that i read from the ADC.

Regards

Rosine

• ###### 6. Re: Is it possible to read sine wave at the input of PSOC 5?

The value of sine voltage (avg or pk-pk or rms) or period or frequency or ....?

What property of the sine do you want controlling the PWM ?

Regards, Dana.

• ###### 7. Re: Is it possible to read sine wave at the input of PSOC 5?

Hello Dana,

The value of sine voltage (avg or pk-pk or rms) or period or frequency or ....?

the frequenz: 50Hz

Amplitude: max 3.3V and min 0V

What property of the sine do you want controlling the PWM ?

the angle.

Regards

Claire

• ###### 8. Re: Is it possible to read sine wave at the input of PSOC 5?

If you are trying to measure the phase angle between two sines (same known frequency)

then the easy way is to measure the time difference between zero crossings from one sine

to the other. That time delay is a direct f() of phase angle. So first zero crossing start timer,

second crossing initiate a capture and/or read of the timer.

I would set timer up for 5 Khz, gives a resolution of 100 or 3.6 degrees per count.

Regards, Dana.

Something like this -

Some other approaches here that are kind of interesting -

electronics.stackexchange.com/questions/45485/how-to-calculate-phase-shift-between-two-sine-wavefroms

like the add the two sines and measure their sum. Works if both sines same amplitude and frequency.

Regards, Dana.