哪位老师帮忙看下 配置完以后 RA7还是不能当IO使用 驱动不了
// CONFIG1
#pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin)
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled)
#pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR)
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled)
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled)
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
#pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled)
#pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled)
// CONFIG2
#pragma config WRT = OFF // Flash Memory Self-Write Protection (000h to 1FFFh write protected, no addresses may be modified by EECON control)
#pragma config VCAPEN = OFF // Voltage Regulator Capacitor Enable (All VCAP pin functionality is disabled)
#pragma config PLLEN = ON // PLL Enable (4x PLL enabled)
#pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will not cause a Reset)
#pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), high trip point selected.)
#pragma config LVP = ON // Low-Voltage Programming Enable (High-voltage on MCLR/VPP must be used for programming)gramming)
OSCCONbits.IRCF = 0b1110;
OSCCONbits.SPLLEN = 0b1;
OSCCONbits.SCS = 0b00;
LATA = 0;
LATB = 0;
LATC = 0;
LATD = 0;
LATE = 0;
/* APFCON Initial */
APFCON = 0;
OPTION_REG = 0;
/* GPIOA */
TRISAbits.TRISA0 = 0;
TRISAbits.TRISA1 = 1;
TRISAbits.TRISA2 = 1;
TRISAbits.TRISA3 = 1;
TRISAbits.TRISA4 = 0;
TRISAbits.TRISA5 = 1;
TRISAbits.TRISA6 = 0;
TRISAbits.TRISA7 = 0;
ANSELAbits.ANSA0 = 0;
ANSELAbits.ANSA1 = 1;
ANSELAbits.ANSA2 = 1;
ANSELAbits.ANSA3 = 1;
ANSELAbits.ANSA4 = 0;
ANSELAbits.ANSA5 = 0;
|