完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我的板应该使用引脚RB1和RB2,每个读取按钮按下。为此,我通过一个100K电阻将每个引脚连接到3V3电源线。这两个按钮然后“接地”在电阻器和PIC引脚之间的相应馈电。课本上的东西。我发现插脚总是按压读。一个多表检查显示,每个引脚上的电压大约是1V65,而不是我预期的3V3。在100K电阻之前,万用表读取一个稳定的3V3,所以很明显有东西在拉低电压。最后,作为最小功能测试,我只配置了数字、输出和高电平的引脚。为此,我绝对期望在引脚上看到3V3,但它仍然是1V65。如果情况可能不同的话,我使用PIC18LF46J50。还有一些额外的配置我忽略了吗?谢谢。
以上来自于百度翻译 以下为原文 My board is supposed to use pins RB1 and RB2 to each read a button press. For this I have each pin tied to the 3V3 power line via a 100K resistor. The two buttons then "ground" the corresponding feed between the resistor and the PIC pin. Textbook stuff. I found that the pins are always reading as pressed. A multi-meter check reveals that the voltage on each pin is around 1V65 rather than the 3V3 that I was expecting. The multi-meter reads a steady 3V3 BEFORE the 100K resistor, so clearly something is pulling the voltage down. Finally, as a minimum function test I merely configured the pins for digital, output and high. For this I would definitely expect to see 3V3 on the pins, but it is still 1V65. Just in case it might make a difference I am using the PIC18LF46J50 . Is there some additional configuration that I have overlooked? Thanks. ANCON1bits.PCFG8 = 1; /* Set RB2/AN8 for digital not analogue */ ANCON1bits.PCFG10 = 1; /* Set RB1/AN10 for digital not analogue */ INTCON2bits.RBPU = 1; /* Disable pull-up resistors just in case */ TRISBbits.TRISB2 = 0; /* Set pins for output */ TRISBbits.TRISB1 = 0; LATBbits.LATB2 = 1; /* Set pin output = high */ LATBbits.LATB1 = 1; /* Now I would expect to see 3V3 on the pins but something * is dragging down the voltage */ |
|
相关推荐
4个回答
|
|
请发布你的整个最小程序。所有的,包括,配置,工作。输出半电压的声音,像一个快速复位的设备。
以上来自于百度翻译 以下为原文 Please post your ENTIRE minimal program. Everything, #includes, config settings, the works. Outputting half voltage sounds like a device that is resetting rapidly. |
|
|
|
建议:去掉你的电阻。使用内部拉柱。(不输出)
以上来自于百度翻译 以下为原文 Suggest: Ditch your resistors. Use the internal pullups. Set the pins for INPUT! (not output) |
|
|
|
如果如上所述,当设置高电平时,OP不能获得接近VDD电平的输出(读取1.6 V而不是接近3.3 V的东西),那么设置输入模式的引脚实际上将不会有太大的帮助,有些东西是错误的,非常错误。张贴整个测试程序代码和可能的示意图将是下一步要采取的措施。
以上来自于百度翻译 以下为原文 If as stated the OP cannot get the outputs to read close to the Vdd level when set high (reading 1.6 v instead of something close to 3.3 v) then setting the pins for input mode is really not going to be of much help, something else is wrong, very wrong. Posting the entire test program code and maybe a schematic would be the next step to take. |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5250 浏览 9 评论
2037 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3219 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2266 浏览 5 评论
792浏览 1评论
682浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
613浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
686浏览 0评论
585浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 20:52 , Processed in 1.354554 second(s), Total 82, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号