Page 1 of 1

HEX with interrupt in PPPV3 won't work, pickit3 does

Posted: Wed Nov 14, 2012 9:28 am
by Jaspervdw
I'm making a project in MPLABX with XC8.
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 PPPV3 en the E-block board, the program won't run.
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?

Re: HEX with interrupt in PPPV3 won't work, pickit3 does

Posted: Wed Nov 14, 2012 10:29 am
by Benj
Hello,

That seems odd, which chip are you using?

Re: HEX with interrupt in PPPV3 won't work, pickit3 does

Posted: Wed Nov 14, 2012 5:46 pm
by Jaspervdw
Hey,

I'm using the PIC16F887. I included the hex file as example.

Re: HEX with interrupt in PPPV3 won't work, pickit3 does

Posted: Wed Nov 14, 2012 6:26 pm
by Jaspervdw
Sorry,

I does does work, I only have to reset the circuit after uploading.