XC8 CONFIG

http://homepage3.nifty.com/mitt/pic/xc8/xc8_ix.html
http://pub.ne.jp/iga_eng/?entry_id=4579986


/** C O N F I G U R A T I O N B I T S ******************************/

//#pragma config FOSC = INTIO67
//#pragma config WDTEN = OFF, LVP = OFF, MCLRE = OFF

//#pragma config FOSC = INTRCIO // INTOSCIO oscillator: I/O function on.
//#pragma config FCMEN = OFF // Fail-Safe Clock Monitor is disabled
//#pragma config IESO = OFF // Internal External Switchover mode is disabled

#pragma config WDTE = OFF // WDT disabled
#pragma config PWRTE = ON // PWRT enabled
#pragma config MCLRE = ON // MCLR pin function is MCLR
#pragma config CP = OFF // Program memory code protection is disabled
#pragma config CPD = OFF // Data memory code protection is disabled
#pragma config BOREN = ON // BOR enabled
#pragma config WDTE = OFF // WDT disabled



/** I N C L U D E S **************************************************/
//#include "p18f45k20.h"
#include "pic.h"
//__CONFIG (UNPROTECT & LVPDIS & BORDIS & MCLRDIS & PERTEN & WDTDIS & INTIO);
//#pragma config (UNPROTECT & LVPDIS & BORDIS & MCLRDIS & PERTEN & WDTDIS & INTIO);
//__CONFIG _HS_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF;
//__CONFIG(FOSC_INTRCIO & WDTE_OFF & PWRTE_ON & MCLRE_OFF);




/** D E C L A R A T I O N S ******************************************/


void main (void)
{
unsigned int i;
unsigned char vLED = 0x01;
TRISB=0xF0;
while(1){
if(RB4==1){
vLED = vLED>>1;
if (vLED==0x00){vLED=0x08;}
}else{
vLED = vLED<<1;
if(vLED==0x10){vLED=0x01;}
}
PORTB = vLED;
for(i=20000;i>0;i--);
}
// TRISD = 0b00000000; // PORTD bit 0: 7 to output (0);
// TRISD = 0b01111111; // PORTD bit 7 to output (0); bits 6:0 are inputs (1)

// LATDbits.LATD7 = ~LATDbits.LATD7; // toggle LATD
// LATDbits.LATD0 = 1; // Set LAT register bit 0 to turn on LED
// LATDbits.LATD3 = 1; // Set LAT register bit 3 to turn on LED
// LATDbits.LATD7 = 1; // Set LAT register bit 7 to turn on LED
// LATDbits.LATD7 = 1; // Set LAT register bit 7 to turn on LED
// Delay1KTCYx(50); // Delay 50 x 1000 = 50,000 cycles; 200ms @ 1MHz
//while (1)


}