完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我和我一起拥有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 } 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
|
|
相关推荐
3个回答
|
|
你好,夏拉文,
函数ftoa为每个调用使用相同的静态缓冲区。因此,它将包含最新的转换结果。您可以声明两个单独的缓冲区,以达到最小和最大值。在调用FTOA之后,您可以将FTA缓冲区复制到您声明的最小和最大缓冲区, 谢谢, 萨姆普斯 以上来自于百度翻译 以下为原文 Hello Shravan, The function ftoa uses the same static buffer for every call. Hence, it would contain the latest conversion result. You can declare two separate buffers for minimum and maximum. After calling ftoa, you can copy the ftoa buffer to the buffer you have declared for minimum and maximum, Thanks, Sampath |
|
|
|
clslda 发表于 2018-9-6 08:43 谢谢你的回复Sampath。 我是一个新手,擅长编码。你能告诉我如何为FTA命令声明和使用不同的缓冲区吗? 当做 谢拉万 以上来自于百度翻译 以下为原文 Thank you for the reply Sampath. I am a novice at coding and stuff. Can you tell me as to how to declare and use different buffers for the ftoa command ? Regards Shravan |
|
|
|
您可以像这样声明缓冲区 Char Stimax〔8〕; Char Srimo〔8〕; //复制FTOA缓冲区到声明的缓冲区。 Primult1=FTOA(TEMP1,和ISTATSU1); STRCPY(STRMOST,PRELUT1); Primult2=FTOA(TEMP1,和ISTATSU2); SrcPy(Srimult,Primult2); 以上来自于百度翻译 以下为原文 You can declare buffers like this char strMaximum[8]; char strMinimum[8]; // Copy ftoa buffer to the declared buffers. pResult1 = ftoa(temp1,&iStatus1); strcpy(strMaximum, pResult1); pResult2 = ftoa(temp1,&iStatus2); strcpy(strMinimum, pResult2); |
|
|
|
只有小组成员才能发言,加入小组>>
715个成员聚集在这个小组
加入小组1901 浏览 1 评论
1652 浏览 1 评论
3405 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1568 浏览 6 评论
1380 浏览 1 评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
180浏览 2评论
179浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
318浏览 2评论
344浏览 1评论
58浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-23 15:47 , Processed in 0.992791 second(s), Total 74, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号