1.how to determine the value of R and C ?what is the function of each passive component?i applied different capacitor and resistor then RMS is different between oscilloscope measurement and terminal output.
2.when the amplitude is set to greater than 1,RMS is different between them as well even though i applied your project directly.
3.i have no idea about comparator output.
The input filter cut-off frequency
Fc = 1/(2π R1 C1)
must be much lower than the input signal frequency (50-60Hz). You need to increase the C1 to 1-10uF. The C12 is for buffering of Vref, 0.1 - 1.0uF will work, I used KIT-059 onboard capacitor on pin_02 (1uF). Larger value will take longer time to be charged by the unbuffered Vref.
In the demo the DelSig-ADC range selected is Vref +/- 1.024V. The peak amplitude of the input signal should be kept below 1V to avoid clipping, alternatively, the ADC input range should be increased (e.g. +/- 2.048 V).
(3). I suspect some ground loop. I used internal VDAC to generate Sine wave. I'll try external gen to see the difference.
did edge shifts when input signal is sine or digital clock?
Please attach project archive.
What is the ultimate source of the wave you are measuring? Is it the incoming line AC?
If so, you cannot trust the frequency to be absolutely accurate. Most times the frequency is controlled by the power generating plant probably within +/10%. It's a complex setup where the direct generation of the frequency is usually caused by steam engines coupled onto motors turned into generators.
even though the sine wave is from wave generator,the frequency that i measure is still extra 1hz.
but my oscilloscope is able to measure it accurately .AC power line as well.
It looks like the frequency measurement is done per each period, so there could be jumps related to the noise on sine wave. I suggest to measure AC frequency over several periods to reduce this error. As a solution you can use a frequency meter component from this project
which measures frequency over several full periods within 100ms window (~5 periods).
The UDB Counter is implemented as a synchronous counter that uses the clock input only as a synchronization clock.
The pwm signal has a frequency of 1 Hz so the result will be 60 or 61
odyssey 1 already gave a link
I can't find the LCD_I2C v_02 component in my PSoC Creator 4.2
It seems necessary to get rid of the high-frequency debris in the signal.
Use the RC filter at the input.
thanks your help, /odissey1 and Evgeniy.
your answers are helpful for me.
but the phase difference of two sine waves which i set 30 degree from wave generator,it is not accurate on terminal output.
when the waveforms are square waves,the error of phase difference is only about 0.02 degree.i think it is because of edge shifted at comparator output.are there any solutions?
and i attach lcd_i2c componet.you could download it if you need it.
I can't open archives. To send project use build-in function: (1) Select project in the Project Explorer Panel; (2) File->Create Workspace Bundle-> Minimal. (3) In created zip Archive delete Generated_Source folser to save space.
Sync comparator improves noise immunity, but adds delay.
To measure the phase difference, you have to abandon the synchronization of the comparator, use the identical settings of the comparators.
For example, use a common stable Vref, set the same hysteresis and, possibly, amplify the signal to increase the steepness of the wawe at the input of the comparator.