汇编程序运行正常,如下:
include "P12F629.INC"
__CONFIG _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON &_CP_ON & _CPD_ON & _INTRC_OSC_NOCLKOUT
ORG 0x0
GOTO L_101
L_101 MOVLW 0x08
BSF STATUS,RP0
MOVWF TRISIO
BCF STATUS,RP0
MOVLW 0x07
MOVWF CMCON
MOVLW 0x07
MOVWF GPIO
MOVLW 0x00
MOVWF GPIO
END
但是c程序就是不行,如下:
#include<pic.h>
__CONFIG ( FOSC_INTRCIO & WDTE_OFF & PWRTE_ON & MCLRE_OFF & BOREN_OFF & CP_ON & CPD_ON);
void delay( unsigned char x )
{
unsigned char i,j;
for(i=0;i<x;i++)
for(j=0;j<110;j++);
}
void main(void)
{
TRISIO=0x08;
CMCON = 0x07;
while(1)
{
GPIO=0x00;
delay(10);
GPIO0=0x03;
delay(10);
}
}
到底什么原因啊,mplab ide v8.88,picc v9.83,烧写器是pickit2
|