完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我正在研究一个项目,我使用几乎所有的模拟输入端口。除了一个以外,所有的工作都很好。即使在接地的情况下,在PoNπ23(PORTB.B2)上的AN2已经有0.13V,并且所有ADC结果都错了。引脚共享AN2/C2I2-/VMIO/RPI34/RB2。我没有映射任何引脚到这个输出,安塞尔和tiS是正确设置。我想知道问题是什么,谢谢你的帮助。
以上来自于百度翻译 以下为原文 Hi all, i am working on a project in which I am using almost all analog input of PORTB. All working good except one. AN2 on pin #23 (PORTB.B2) already has 0.13V on it even on grounded situation, and all the ADC results turn wrong. The pins shares AN2/C2IN2-/VMIO/RPI34/RB2. I did not map any pin to this output, ANSEL and TRIS are setup correctly. I was wondering what is the problem. Thank you in advance for your helps. |
|
相关推荐
4个回答
|
|
是的,一个RPIN引脚不能映射到一个输出,而不是一个输入-只是为了清除这个。不知道还有什么可以…PCB短路?
以上来自于百度翻译 以下为原文 Yeah, a RPIn pin can't be mapped to an output, rather to an input - just to clear this one. Not sure what else could be... pcb short? |
|
|
|
谢谢您的响应。它没有短路,因为ADC转换工作很好,它遵循输入。我的问题只是加了13 V!我不知道这是从哪里来的。
以上来自于百度翻译 以下为原文 Thank you for your response. It is not shorted because the ADC conversion is working very well and it follows input. My problem is just added .13 V! I don't know where is this comming from. |
|
|
|
|
|
|
|
没有启动,我切断了这个引脚的轨迹;我的意思是引脚不再连接到电路,但我仍然可以测量0.13V。真的很困惑。我做了一些实验,当我在ICD模式启动电路时,这个引脚显示2V,在配置ADC时,当我设置AD1CON1= 0xB06C时,VoL。TAG降低到0.7 V,设定AD2CON1=0xB0E4后,下降到0.13V。
以上来自于百度翻译 以下为原文 No Pull-up is enabled, I cut the trace off of this pin; I mean the pin is not connected to the circuit anymore, but still I can measure 0.13V. Really confused. I did some experiments, When I start the circuit in ICD mode this pin shows 2V, during configuration ADC when I set AD1CON1=0xB06C; the voltage decreased to 0.7 V and after setting AD2CON1=0xB0E4; it decreased to 0.13V. here is whole ADC configuration void ADCINIT(unsigned int CAPN){ ANSELB=0x003C; AD2CSSL=0x0004; AD2CON2=0x8400 | ((CAPN-1)<<2); // vref determination, channel A is active, increment DMA after 4 conversion, use select bit A while (CAPN>0) { ANSELB=ANSELB|(0x20< AD1CSSH=0x0000; //which one to scan higher word AD1CSSL=0x0000; //which one to scan lower word AD1CHS0=0x0606; //Channel 0 negative is Vref, and A and B intervals input 2 AD1CHS123=0x0101; //Channel 1,2,3 negatives are Vref, and A and B intervals input 3 , 4, 5, respectively AD1CON4=0x0000; //DMA Enable and number of buffer per channel AD1CON3=0x0005; //Clock setup TAD=6*TCY AD1CON2=0x820C; // vref determination, all channels are active, increment DMA after 4 conversion, use select bit A AD1CON1=0xB06C; // DMA address in the order of conversion, trigger pwm event AD2CHS0=0x0000; AD2CHS123=0x0000; AD2CON4=0x0000; //DMA Enable and number of buffer per channel AD2CON3=0x0105; //Clock setup TAD=6*TCY; sampling time 118 ns AD2CON1=0xB0E4; } |
|
|
|
只有小组成员才能发言,加入小组>>
5163 浏览 9 评论
2000 浏览 8 评论
1928 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3174 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2226 浏览 5 评论
733浏览 1评论
615浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
505浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
631浏览 0评论
528浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 02:00 , Processed in 1.162663 second(s), Total 54, Slave 47 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号