// ver 0.1 (28-Mar-06)
// HCS12XE Core erasing + unsecuring command file:
// These commands mass erase the chip then program the security byte to 0xFE (unsecured state).

FLASH RELEASE

reset
wb 0x03c 0x00	 //disable cop
wait 20


WB 0x100 0x04   // clock divider for 4 MHz Xtal

WB 0x106 0x30   // clear any error flags
WB 0x102 0x00   // CCOBIX = 0
WB 0x10A 0x08   // load erase all blocks command
WB 0x106 0x80   // launch command
WAIT 10

reset

WB 0x106 0x30   // clear any error flags
WB 0x102 0x00   // CCOBIX = 0
WB 0x10A 0x06   // load program command
WB 0x10B 0x7F   // load GPAGE
WB 0x102 0x01   // CCOBIX = 1
WB 0x10A 0xFF   // load addr hi
WB 0x10B 0x08   // load addr lo
WB 0x102 0x02   // CCOBIX = 2
WB 0x10A 0xFF   // load data
WB 0x10B 0xFF   // load data
WB 0x102 0x03   // CCOBIX = 3
WB 0x10A 0xFF   // load data
WB 0x10B 0xFF   // load data
WB 0x102 0x04   // CCOBIX = 4
WB 0x10A 0xFF   // load data
WB 0x10B 0xFF   // load data
WB 0x102 0x05   // CCOBIX = 5
WB 0x10A 0xFF   // load data
WB 0x10B 0xFE   // load data
WB 0x106 0x80   // launch command
WAIT 1
