/********************************/ /* Include File */ /********************************/ #include //#include //#include /********************************/ /* Fuse Setting */ /********************************/ _FOSCSEL(FNOSC_FRCPLL); //Internal FRC _FOSC(FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMD_NONE); _FWDT(FWDTEN_OFF); //WDT Off _FGS(GCP_OFF); //Code Protect Off /****************************/ /* 各種定義 */ /****************************/ #define LED PORTAbits.RA0 #define LED_OFF 1 #define LED_ON 0 /****************************/ /* mS wait */ /****************************/ void wait_ms(int wTime){ //clock(Tcy)=36.85MHz 1clock=27.137nS int i; T1CONbits.TCKPS = 1; //1/8 @36.85MHz T1CONbits.TON = 1; //Timer1 start for(i=0; i