你好,
我和我一起拥有PSoCalEVE 1 CY32 10工具包。我需要测量我输入的交流输入信号的最大和最小电压。信号是正弦的PK到3伏的PK,在频率为500赫兹的频率下振荡0.5到3.5伏。我用信号发生器给输入所以我随意设定频率。我有不同的偏移量为输入电压是正的直流。
我需要计算Vmax和Vmin峰值信号。然后Vpeak =(Vmax -Vmin)/ 2
VRMS=VPK*0.7071
这就是我的目标。我现在用的电压表的项目,我得到的柏树和我正在编辑的程序是适合我的需要。
该项目是利用输入经过PGA增益1。然后通过12位分辨率的ADCcNVR发送。
我用一个简单的方法来获得Vmax和Vmin如下。我想显示在LCD上。
如果(fvvts & gt;TEMP1){
Tunv1=fVoTs;// Vmax
}
如果(fvolts <;temp2){ // Vmin
tim2=fVoTS;
}
问题是,这两个值显示的是直流偏置值都是相同的。
我附上的项目在这里。请帮帮我。
当做
谢拉万
CE5687.CaseV1.ZIP
348.3 K
以上来自于百度翻译
以下为原文
Hello there,
I am having PSOCEVAL 1 CY3210 Kit with me. I need to measure the max and min voltages for the ac input signal that i am giving. The signal is a sinusoidal with pk to pk of 3 volts, oscillating in 0.5 to 3.5 volts at frequency 500 Hz. I am using a signal generator to give the input so i am at liberty to set the frequency. I have varied the DC offset as for the voltage input to be only in positive.
I need to calculate the Vmax and Vmin peak values of the signal. Then Vpeak= (Vmax- Vmin)/2
Vrms=Vpk*0.7071
This what i am aiming to acheive. I am now using a voltmeter project that i got form the cypress and i am trying to edit the program to be suitable to my need.
The project is using the input to go through a PGA with 1 gain. Then it is sent through ADCINCVR with 12 bit resolution.
I am using a simple method to get Vmax and Vmin as follows. I am trying to display both on the LCD.
if(fVolts>temp1){
temp1=fVolts; //Vmax
}
else if(fVolts
temp2=fVolts;
}
The problem is that both values shown are DC bias values and both are same.
I am attaching the project here. Please help me with this.
Regards
Shravan