RF5/AN10/C1INB/CVREF
脚上标的是这
程序关闭AD功能了 但是还是读取回来全是0,万用表测量时3V
下面是程序
#include<pic18.h>
__PROG_CONFIG(1,0x0C80); //配置PIC18F67J11
__PROG_CONFIG(2,0xF504);
__PROG_CONFIG(3,0xFFB8);
#define SCL PORTFbits.RF6
#define SDA PORTFbits.RF5
#define LED1 PORTAbits.RA3
#define LED2 PORTAbits.RA2
void main()
{
unsigned char i = 0;
SWDTEN = 0;
ANCON1 = 0xFF;
TRISF = 0xFF;
TRISA = 0x00;
PORTF = 0xFF;
LED1 = 1;
while(1)
{
if(SDA)
LED2 = 1;
else
LED2 = 0;
}
}
|