完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我试图用ADC读取一个负的直流值,但是它不能在LCD上显示正确的负值。我把AGND带到外部。我从函数发生器产生直流电压。我附上我的项目文件。我不是很擅长C编码所以我刚刚发现了一个示例项目和改进的一点。请告诉我如何解决这个问题。我正在使用CY8CKIT-1001开发板上的POSC 3。
不及物动词 谢谢 多路复用器 2.2兆字节 以上来自于百度翻译 以下为原文 I'm trying to use ADC to read a negative DC values but it doesn't display the correct negative values on the LCD. I brought the Agnd to an external. I'm generating this dc voltage from a function generator. I attached my project files . I'm not very good at C coding so i just found an example project and modified a little bit. Please tell me how i can fix this problem. I'm using POSC 3 on the Cy8Ckit-001 Development board. Vi Thanks
|
|
相关推荐
6个回答
|
|
你好,VL123,
在测试你的项目之后,这里有一些建议: 1)将ADCs结果声明为签名而不是未签名。这是为了适应负读数,因为你正在使用差分模式下的ADC。 2)由于在多示例模式下使用ADC,所以在循环中使用ADCYSTATESTORE()后,应使用ADCYSTARTIFECT()API。 3)一旦使用ADCI ISEDN转换(ADCJWAITIOFFORY结果)获得ADC结果,就可以立即使用ADCY-StCurror()。没有必要在“IF”语句中检查ADCWAWITITY FURY结果。它总是返回一个false,因为AdcWaWiTyFuRy结果被定义为宏中的0。ADCXSTECUTHT()API永远不会执行。 4)在项目中,将三个负端子PiN4、PiNi 5和PiN6连接到模拟接地Agnd。这样,你可以测量模拟地面以下的电压。然而,要注意负电压不应低于PSoC数字接地的事实。 以上来自于百度翻译 以下为原文 Hi vl123, After testing your project, here are the suggestions: 1) Declare the ADCResult as signed instead of unsigned. This is to accomodate negative readings since you are using the ADC in differential mode. 2) SInce you are using ADC in multi-sample mode, the ADC_StartConvert( ) API should be used after ADC_StopConvert( ) in the loop. 3) Once the ADC result is obtained using ADC_IsEndConversion(ADC_WAIT_FOR_RESULT), the ADC_StopConvert() can be used immediately. There is no necessity to check for ADC_WAIT_FOR_RESULT in "if" statement. It always returns a false as ADC_WAIT_FOR_RESULT is defined as 0 in a macro. The ADC_StopConvert() API would never execute. 4) In the project, connect the three negative terminals, Pin_4, Pin_5 and Pin_6 to the analog ground Agnd. This way you can measure the voltage below the analog ground. However be cautious of the fact that the negative voltage should not go below the PSoC digital ground. |
|
|
|
当使用CY8CKIT-1001时,确保VDD选择(3.3V或5V)上的电压设置与在操作条件中选择的电压一致。它可以在CYDWR & GT系统中进行修改。为Vddd、VDDA和VDDIO选择合适的电压。
该项目修改之前指定和附加的变化。 让我们知道这是否有帮助。 MuxTest.1.Zip 329.1 K 以上来自于百度翻译 以下为原文 When using the CY8CKIT-001, make sure that the voltage settings on VDD SELECT (3.3V or 5V) is in accordance with the voltage selected in the Operating Conditions. It can be modified in .cydwr > System > Operating Conditions. Select the right voltages for Vddd, Vdda and Vddio's. The project is modified with the changes specified before and is attached. Let us know if this helps.
|
|
|
|
Ganesh Raaja的博客文章解释了如何使用PSoC1测量负电压。这将是一个有益的阅读。这个帖子的链接是HTTP://www. CyPress?RID=50815和cAMP=0
以上来自于百度翻译 以下为原文 A blog post by Ganesh Raaja explains how to measure negative voltage using PSoC1. This will be a useful reading. The link to this post is http://www.cypress.com/?rID=50815&cache=0 |
|
|
|
嗨,Dasq,
首先,我只想说一声谢谢。我非常感谢你的帮助。我一直在琢磨这个问题。 它肯定奏效了。但是还有一个问题,当我去负约-2.49,变得积极又还当我达到约2阳性有点不稳定伏,像改变的很快。你知道为什么吗? 谢谢 不及物动词 以上来自于百度翻译 以下为原文 Hi Dasq, First of all , I just want to say thank you very much. I really appreciate your help. I've been scratching my head over this. It definitely works. But one more question, When i go negative to about -2.49 , it becomes positive again and also when i reach about +2 positive volts , its kinda unstable like changing really fast. Do you know why ? thanks a lot Vi |
|
|
|
你好,VL123,
由于您正在使用具有16位分辨率的ADC,建议将变量ADCREST声明为IT32(签名32位),并使用ADCJGETRESUT32()API读取它。 这可以消除从负值(从-2.5V过渡到正值)滚动到正值的问题。 以上来自于百度翻译 以下为原文 Hi vl123, Since you are using ADC with 16-bit resolution, it is recommended to declare the variable ADCResult as int32 (signed 32 bit) and read it using ADC_GetResult32( ) API. This might eliminate the issue of rolling over to positive value from negative (transition from -2.5V to positive value). |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2100 浏览 1 评论
1846 浏览 1 评论
3664 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
559浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
410浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
905浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 12:27 , Processed in 0.941139 second(s), Total 89, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191