Start-up Code for Expanded Mode

Put the following code into byte-erasable EEPROM at address 0x0D00.

To boot your HC12 into single-chip mode, put jumpers W3 and W4 into position 0, and push the reset button.

To boot your HC12 into wide expanded mode, put jumper W3 into postion 0, jumper W4 into postion 1, and push the reset button.


>asm $0D00

LDS   #$0C00      ; Load DBug-12 stack pointer
CLR   $0016       ; Disable COP 
LDX   #$0A00      ; Clear out DBug12 RAM
CLR   1,X+        
CPX   #$0C00      
BNE   $0D09       
LDAA  #$2C        ; Enable LSTRB and R/W 
STAA  $000A       
BSET  $000B,#$68  ; Expanded wide mode, turn on internal visibility
BCLR  $0013,#$08  ; Put in one E-Clock stretch
JMP   $F717       ; Jump to DBug-12