I'm using follwing code:
Code: Select all
#include <xc.h>
#define _XTAL_FREQ 19660800
#pragma config CONFIG1 = 0x2FF2;
#pragma config CONFIG2 = 0x3FFF;
/*
*/
void interrupt timer0(){
INTCONbits.T0IF = 0;
PORTC = 0X77;
}
void main() {
//TImer 0
OPTION_REGbits.T0CS = 0;
OPTION_REGbits.T0SE = 0;
OPTION_REGbits.PSA = 0;
OPTION_REGbits.PS2 = 1;
OPTION_REGbits.PS1 = 1;
OPTION_REGbits.PS0 = 1;
TMR0 = 0;
INTCONbits.T0IE = 1;
INTCONbits.GIE = 1;
TRISC = 0x00;
PORTC = 0x01;
while(1){
//PORTC = TMR0;
//__delay_ms(499);
}
}
When I program the pic with the pickitt3, then put the PIC back in the E-block, the program run's correctly.
Anyone an idea?