完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好。这是我的第一篇文章,因为我一直在寻找答案,因为其他人也有类似的问题,但这次我被难住了。我希望使用RA3和RA4来监视一个机构上的2个霍尔传感器(位置和机构的扩展位置)。但是,我已经断开了传感器,用按钮取代了传感器。RA3和RA4都有自己的拉高到5V,每一个都有一个常开的按钮来接地(更换传感器)。如果没有代码运行,如果我用电压表监视RA3或RA4端口,我就可以从5V到0V转换干净。RA3当RA3按钮被按下,当RA4按钮被按下时,RA4就干净了。现在奇怪的比特…如果我监视RA4和按下RA3(SiC)按钮,那么RA4电压保持在5V(如预期的那样)……如果监视器RA4和按钮RA3(SiC),如果代码是循环的,寻找RA3过渡。然后RA4下降到0V,然后需要大约4秒上升到5V。这就导致了进一步的代码预触发。我已经做了一些测试,这似乎只有当代码实际监测RA3时才发生。如果代码在别处,那么这不会发生。我没有在家中访问的范围,但这种倾斜可以清楚地看到一个体面的数字电压表。有人知道为什么会发生这种情况吗?RA3和RA4都被配置为输入。07H被写入CCMON寄存器以关闭比较器。VRCON被关闭(尝试打开和关闭)。中断没有设置。我已经尝试了所有4种可能组合的选项RG位4和5。想不出别的什么可以尝试了吗?非常感谢您的帮助。谢谢,凯文。
以上来自于百度翻译 以下为原文 Hello to all. This is my first post as I have always found answers as others have had similar issue, but this time I'm stumped. Hoping someone can help. I am using RA3 and RA4 to monitor 2 hall sensors on a mechanism (Home position and extended positions of the mechanism). However I have disconnected the sensors and replaced with buttons to exclude the sensors as a problem. Both RA3 and RA4 have their own pull up to 5v. Each then has a normally open push button to ground (replacing the sensors). Without the code running, if I monitor the RA3 or RA4 ports with a voltmeter I get clean transitions from 5v to 0v. With the code running I still always get clean transitions on RA3 when RA3 button is pressed, and clean on RA4 when RA4 button is pressed. Now the weird bit... If I monitor RA4 and press RA3 (sic) button then RA4 voltage remains at 5v (as would be expected) however... If monitor RA4 and press button RA3 (sic) and if the code is looping looking for RA3 transition then RA4 dips close to 0v and then takes about 4 seconds to rise back to 5v. This is then causing further code to pre trigger. I have done a few tests and this only seems to happen when the code as actually monitoring RA3. If the code is elsewhere then this does not happen. I do not have access to a scope at home, but this dip can be clearly seen on a decent digital voltmeter. Anybody got any idea why this may be happening? RA3 and RA4 are both configured as inputs. 07h is written to the CMCON register to turn off the comparators. VRCON is turned OFF (Tried on and off). Interrupts not set up. I have tried all 4 possible combinations for Option Reg bits 4 and 5. Can't think of anything else to try? Any help will be very much appreciated. Thanks, Kevin |
|
相关推荐
3个回答
|
|
如果您正在波尔塔上的其他位(如输出)上进行位操作,那么您可能正在经历RMW效应。张贴你的代码,我们不需要猜测这么多(希望)。
以上来自于百度翻译 以下为原文 If you are doing bit manipulations on other bits (as outputs) in PORTA then possibly you are experiencing RMW effects. Post your code and we won't need to guess quite so much (hopefully). |
|
|
|
RMW不能影响输入引脚。如果代码在C中,或者ASM,则没有提及。我猜它是在ASM中,并且代码中有一个银行选择错误。正如已经指出的,我们只能猜测何时不发布代码。
以上来自于百度翻译 以下为原文 RMW can't affect input pins. No mention has been made if the code is in C, or in ASM. My guess it is in ASM, and a bank selection mistake has been made in the code. As already noted, we can only guess when you do not post the code. |
|
|
|
是的,当然,没有任何原理或代码,我正在为可能的布线错误和可能的RMW一起工作,在黑暗中真的是一个猜测(而且可能不是很好的猜测!).
以上来自于百度翻译 以下为原文 Yes of course, without any schematic or code I was working toward a possible wiring error combined with possible RMW, truely a guess in the dark (And probably not a very good guess at that!). |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
776浏览 1评论
665浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
594浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
675浏览 0评论
575浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 23:12 , Processed in 1.067808 second(s), Total 46, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号