完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,大家好,
这应该是一个非常基本的问题,所以请原谅我。我试图检测PSoC引脚上的电压。它要么是3V,要么是0V。我现在使用的PIN是P0(0),它的驱动程序是下拉的。我将PRT0DR位初始化为0,但当电压为3V时,我从未读过高值。有什么地方我做错了吗? 本质上,我希望PSoC在施加电压时读取高值,而在引脚浮动时读取低值。 以上来自于百度翻译 以下为原文 Hi All, This should be a very basic question, so forgive me. I'm trying to detect a voltage on a PSoC pin. It's either going to be 3V or 0V. The pin I am using is currently P0[0] and I have its drive set as Pull Down. I initialize the PRT0DR bit to 0, but I never read a high value when the voltage is 3V. Is there something that I am doing wrong? Essentially I want the PSoC to read a high value when a voltage is applied and a low value when the pin is floating. |
|
相关推荐
4个回答
|
|
|
你是怎么看密码的?你使用PRT0DR寄存器吗?看看下面的博客文章可能会有帮助。PSoC GPIO去神秘化-第1部分PSoC GPIO解谜-第2部分最佳问候,GSONH PSoC黑客
以上来自于百度翻译 以下为原文 How are you reading the pin? Are you using the PRT0DR register? Check out the below blog posts that may be of help. PSoC GPIO Demystified - Part 1 PSoC GPIO Demystified - Part 2 Best Regards, Ganesh The PSoC Hacker |
|
|
|
|
|
谢谢您的回复!
是的,我试着阅读PRT0DR上的一点。我基本上是这样做的: 如果(PRT0D&P;X) { TruteF旗=1; } 其他的 { TruteF旗=0; } 以上来自于百度翻译 以下为原文 Thank you for responding! Yes, I am trying to read the bit on PRT0DR. I am essentially doing this: if (PRT0DR & X) { trueFlag = 1; } else { trueFlag = 0; } |
|
|
|
|
|
更新-
我把选择的模式切换到高Z而不是下拉,现在它工作了!谢谢你的帮助! 以上来自于百度翻译 以下为原文 Update - I switched the Selected mode to High Z instead of Pull Down and now it works! Thank you for the help! |
|
|
|
|
|
欢迎光临!很高兴听到你找到了解决办法并让它奏效了。
最好的问候, 加内什 PSoC Hacker 以上来自于百度翻译 以下为原文 You are most welcome!! Glad to hear that you found the solution and got it working. Best Regards, Ganesh The PSoC Hacker |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2474 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2073 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7566浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6114浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7962浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 22:06 , Processed in 0.867199 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1231