futz
Active Member
Yesterday I breadboarded up my new PIC24HJ12GP202 and wrote a quick C30 blinky program to flash LEDs on RB12-15. No problems. That worked fine.
This morning I plug it in and it's flashing away fine. I make a trivial change to the program - nothing that would cause any problem at all, compile and program. And... nothing! It's dead! WTF?
I've checked everything I can think of but can't get a flash out of it. Tried to use the PICkit2 as debugger but it gives "PK2Error0028: Unable to enter debug mode"
The simulator runs the program just fine. Exactly the same as yesterday.
Can you guys "stupid check" this code. Have I made a mistake I can't see?
This morning I plug it in and it's flashing away fine. I make a trivial change to the program - nothing that would cause any problem at all, compile and program. And... nothing! It's dead! WTF?
I've checked everything I can think of but can't get a flash out of it. Tried to use the PICkit2 as debugger but it gives "PK2Error0028: Unable to enter debug mode"
The simulator runs the program just fine. Exactly the same as yesterday.
Can you guys "stupid check" this code. Have I made a mistake I can't see?
Code:
#include "p24hj12gp202.h"
_FOSCSEL(FNOSC_FRC) //osc
_FWDT(FWDTEN_OFF)
void delay(void);
int main(void)
{
TRISB = 0x0000;
ADPCFG = 0xffff; //all digital
while(1)
{
LATBbits.LATB15=1;
delay();
LATBbits.LATB15=0;
delay();
LATBbits.LATB14=1;
delay();
LATBbits.LATB14=0;
delay();
LATBbits.LATB13=1;
delay();
LATBbits.LATB13=0;
delay();
LATBbits.LATB12=1;
delay();
LATBbits.LATB12=0;
delay();
}
}
void delay(void)
{
int x,y;
for(x=0;x<17;x++)
{
for(y=0;y<10000;y++){}
}
}