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
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.
Thank for the reply. Please can i have an example project about this issue?
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?
i would like to change the duty cycle of the PWM based on the value that i read from the ADC.
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,
3) Any measurement latency concerns ?
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 ?
the frequenz: 50Hz
Amplitude: max 3.3V and min 0V
Thanks for replying
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.
Something like this -
Some other approaches here that are kind of interesting -
like the add the two sines and measure their sum. Works if both sines same amplitude and frequency.