P5OUT|=MOSI+SCK+RST;
P5DIR|=MOSI+SCK+RST;
//P5DIR&=~MISO; //MOSI is MISO
+
+ //P5REN=0xFF;
+
}
//! Initialize the debugger
void ccdebuginit(){
+ delay(30); //So the beginning is ready for glitching.
+
//Two positive debug clock pulses while !RST is low.
//Take RST low, pulse twice, then high.
P5OUT&=~SCK;
void cc_lockchip(){
register int i;
- debugstr("Locking chip.");
+ //debugstr("Locking chip.");
cc_wr_config(1);//Select Info Flash
if(!(cc_rd_config()&1))
debugstr("Config forgotten!");
cmddata[1]=0xc7;
cmddata[2]=0x51;
cc_debug_instr(3);
- debugstr("Loaded bank info.");
+ //debugstr("Loaded bank info.");
cc_set_pc(0xf000+MAXFLASHPAGE_SIZE);//execute code fragment
cc_resume();
- debugstr("Executing.");
+ //debugstr("Executing.");
while(!(cc_read_status()&CC_STATUS_CPUHALTED)){
}
- debugstr("Done flashing.");
+ //debugstr("Done flashing.");
P1OUT&=~1;//clear LED
}