打印

PIC16F1937 RA7配置成IO问题请教

[复制链接]
1368|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
keykay|  楼主 | 2015-12-27 14:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
哪位老师帮忙看下 配置完以后  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;

沙发
keykay|  楼主 | 2015-12-27 15:27 | 只看该作者
问题已解决 配置没有问题

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

9

帖子

0

粉丝