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

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Jaspervdw
Posts: 12
Joined: Fri Dec 12, 2008 4:45 pm
Been thanked: 3 times
Contact:

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

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

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

Post by Benj »

Hello,

That seems odd, which chip are you using?

Jaspervdw
Posts: 12
Joined: Fri Dec 12, 2008 4:45 pm
Been thanked: 3 times
Contact:

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

Post by Jaspervdw »

Hey,

I'm using the PIC16F887. I included the hex file as example.
Attachments
001_-_Blinking_Led.X.production.hex
(396 Bytes) Downloaded 530 times

Jaspervdw
Posts: 12
Joined: Fri Dec 12, 2008 4:45 pm
Been thanked: 3 times
Contact:

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

Post by Jaspervdw »

Sorry,

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

Post Reply