完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好柏柏社区!
我最近开始在CY8CKIT-042-BLE(CY8C4247LQI-BLE,具体地)为办公室的一个小型研发项目进行实验。在没有太多细节的情况下,我们试图精确测量可变电阻的电阻。特别是,我在这个应用中测量9个单独的电阻器的电阻。 我已经附上了我设法凑在一起的项目文件,这看起来现在起作用了(请原谅写得不好的代码和糟糕的配置图,这里仍然是新的)。我已经声明了适当的模拟引脚,传感器的一端连接到,而所有传感器的接地端都连接到J1上的GND。CopsCH将传感器连接到AMUX,AMUX使用IDAC和ADC块的组合来向每一个模拟引脚注入少量电流,然后ADC测量每个电阻器两端的电压降。从这个,我可以采取已知的电流和测量电压和(V=IR)计算在那个时间点的传感器的电阻。 对于设计文件还有一点,但大部分是1)准确地收集所收集的数据,并且2)创建一个UART连接,这样我就可以在终端上打印这些值并将它们捕获到我的PC上的文本文件。 好的,几个重要的问题: 1)ADC的最大电压是多少?ADC块具有Vref连接到VDDA,并且单端负输入也被设置为Vref。这将“单端模式范围”设置为“VDDA(3.3 V)至0”,并且,当我完全从板断开传感器时,我看到3.301643伏印刷到终端(打开连接)。我知道这些非常接近,但它们并不完全相同。这种差异是正常的吗? 2)我的ADC被配置为12位,它应该是4096计数全范围。当我增加了我的传感器的电阻,我可以得到它高达8200个计数,这只是超过13位。我的ADC配置不正确吗? 3)我注意到,对于单个传感器来说,ADC报告的一些电压在返回到其他传感器的标称水平之前,会被“1000”计数“翘起”。我已经伸出了传感器供应商,并且在确认我已经连接了电池到工具箱以稳定电路板电压(它只是在USB电缆之前供电)。他们已经评论说,ADC的固有电容相对于AD的时序可能会发生一些事情。C读数。有没有人知道我如何量化和改变我适应的时间? 对于长时间的道歉,非常感谢您的任何评论!如果这是张贴在错误的部分,请指出我在正确的方向。 谢谢您! SobBOX.CyWrk.CaseV04.Zip 2.7兆字节 以上来自于百度翻译 以下为原文 Hello Cypress community! I recently started experimenting with the CY8CKIT-042-BLE (CY8C4247LQI-BLE, to be specific) for a small R&D project in the office. Without going into too much detail, we're trying to accurately measure the resistance of a variable resistor. In particular, I'm measuring the resistance of 9 separate resistors in this application. I've attached the Project file I've managed to cobble together that seems to work at the moment (please excuse poorly written code and badly configured diagrams, still new here). I've declared the proper analog pins that one end of the sensors are connected to, while the grounded end of all the sensors are connected together to GND on J1. The TopDesign.cysch connects the sensors to an AMux, which uses a combination of the IDAC and ADC blocks to inject a small amount of current to each of the analog pins, and then ADC measures the voltage drop across each resistor. From this, I can take the known current and measured voltage and (V = IR) calculate the resistance of the sensor at that point in time. There's a little more to the design file, but most of it is to 1) accurately timestamp the collected data, and 2) create a UART connection such that I can print the values over terminal and capture them to a text file on my PC. Okay, a couple important questions: 1) What is the maximum voltage I should expect into the ADC? The ADC block had Vref connected to VDDA, and the single-ended negative input is also set to Vref. This sets the "Single ended mode range" to "Vdda (3.3 V) to 0.0", and, when I disconnect the sensor entirely from the board, I see 3.301643 volts printed to the terminal (open connection). I know these are quite close, but they're not quite the same. Is this discrepancy normal? 2) I've got the ADC configured to be 12-bit, which should be 4096 counts full range. When I increase the resistance of my sensor, I can get it as high as ~8200 counts, which just exceeds 13 bits. Do I have my ADC configured incorrectly? 3) I've noticed that occasionally some of the voltages reported by the ADC for an individual sensor will "blip" up by a few 1000 counts before coming back down to the nominal level of the other sensors. I've reached out the sensor vendor, and after confirming that I've connected a battery to the kit to stabilize the board voltage (it was just powered off the USB cable before) they've commented that something could be going on with the inherent capacitance of the ADC relative to the timing of my ADC readings. Does anyone have any insight into how I can quantify this and change my timing to accomodate? Apologies for the long read, any comments are greatly appreciated! If this is posted to the wrong section please point me in the right direction. Thank you!
|
|
相关推荐
2个回答
|
|
建议删除所有的数字块,只留下模拟块,如果结果正确,就要进行调试。-保证问题不是由系统/代码/ ISR引起的。
然后一步一步调试,仔细检查结果是否合理。-问题是由IDAC+ADC引起的吗? 在传感器通道上使用外部的VDD+拖拉如何? 谢谢, 赖安 以上来自于百度翻译 以下为原文 Suggest removing all digital blocks just leave analog blocks, have a debug to monitor if the result is correct. - Guarantee the issue is not caused by system/code/isr.... Then debug step by step, to double-check if the result is reasonable. - Is the issue caused by IDAC + ADC ? How about using an external VDD+pull-ups on sensor channels? Thanks, Ryan |
|
|
|
我做了一些额外的调整与我的项目,并找出了一些事情,大大有助于改善事情,主要是通过调整AMUX模块。
1)首先,当试图通过AMUX一次读取一个通道,并且只读取一个通道时,可以通过启用.CysCH文件中的块中的“AtMOSTONActuple”特性来配置AMUX。通过使用这一点,结合调用我的代码中的正确函数(现在使用“yFASTROSEPLATE())而不是“选择SO()))确保只有一个通道一次被AMUX连接。本质上,先前发生的是AMUX在连接新信道之前没有正确地切断旧信道,导致多个电压通过AMUX读取并被SAR ADC转换。这大大消除了问题。我还增加了允许的ADC周期的SAR ADC转换信号,给它足够的开销是安全的。 2)在遍历信道序列之后,在再次迭代之前,我还必须添加第二个函数调用:“快速选择()”,以确保在后续循环中读取正确的信道。这也可能是我自己的代码中的一个bug,因为我现在对我的项目中的这个创可贴很满意。 我还在我的主体中添加了一个NIFTY WHER(),在ADC上转换电压之前,动态地改变IDAC中设置的电流。这大大增加了我的电阻传感器的测量范围,现在的范围从100欧姆的小到2.5米欧姆。对于这种类型的硬件,在传统的分压器电路上无疑是一个优势。 SobBOX.CyWrk.CaseV05.Zip 3兆字节 以上来自于百度翻译 以下为原文 I did some additional tweaking with my project and figured out a couple things that greatly help improve things, mainly by tweaking the AMux module. 1) First, when trying to read one, and only one, channel at a time via the AMux, you can configure the AMux to do so by enabling the "AtMostOneActive" feature in its block in the .cysch file. By using this, in combination with calling the correct function in my code (now use "_FastSelect()" instead of "_Select()") ensures that only one channel is being connected by the AMux at a time. Essentially, what was happening previously was that the AMux wasn't properly disconnecting the old channel before connecting the new channel, causing multiple voltages to be read through the AMux and being converted by the SAR ADC. This greatly cleared things up. I also increased the allowable ADC cycles for the SAR ADC to convert the signal, giving it sufficient overhead to be safe. 2) After iterating through the sequence of channels, and prior to iterating again, I also had to add a second function call of "_FastSelect()" in order to ensure that the proper channel was being read on subsequent loops. This could also be a bug in my own code, by I'm ok with this band-aid in my project for now. I also added a nifty while() inside my main for(;;) that dynamically changes the current being set in the IDAC prior to converting the voltage on the ADC. This greatly increases my measurement range for my resistive sensors, now with a range from as small as 100s of ohms, to up 2.5M ohms. Definitely a plus for this type of hardware over a more conventional voltage divider circuits.
|
|
|
|
只有小组成员才能发言,加入小组>>
756个成员聚集在这个小组
加入小组2122 浏览 1 评论
1865 浏览 1 评论
3681 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1800 浏览 6 评论
1543 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
603浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
450浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
447浏览 2评论
400浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
1081浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-10 07:57 , Processed in 0.891304 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号