	.module _HC12Setup.c
	.area text
__HC12Setup::
; // _HC12Setup.c
; 
; #include <912d60.h>
; #include "kernel.h"
; 
;  
; 
; void _HC12Setup(void) {
; 
; 	 
; 	 // set the register base
; 	 //*(volatile unsigned char *)0x0011 = 0x08;
; 	 
; 	 // set up the SYSTEM CLOCKS
; 	 //SLOW = 0x00;  		  			// don't slow the RTI/COP clocks down
; 	 
; 	 	 
; 	 // set up the RTI INTERRUPT
; 	 INTR_OFF();		  			// disable/mask all maskable interrupts
		sei

; 	 RTICTL = 0x86;			  	 	// enable RTI at 65.536 miliseconds
	ldab #134
	stab 0x14
; 	 //RTICTL = 0x85;					// enable RTI at 32.768 miliseconds
; 	 RTIFLG = 0x80;					// clear real time interrupt flag
	ldab #128
	stab 0x15
; 	 
; 	 
; 	 // set up the COP WATCHDOG clock monitor for 524.288 ms
; 	 COPCTL = 0xC5; 			// COP on
	ldab #197
	stab 0x16
; 	 //COPCTL = 0x00;	   		// COP off
; 	 
; 	 
; 	 // set up the TOF interrupt
; 	 TMSK2  = 0x80;			  // set to interrupt at 16.384 miliseconds
	ldab #128
	stab 0x8d
; 	 TSCR   = 0x80;			  // enable the timer
	ldab #128
	stab 0x86
; 	 PACTL |= 0x0C;			  // ensure the timer is clocked from mclock divider
	bset 0xa0,#12
; 	 HPRIO  = 0xDE;			  // elevate the TOF interrupt
	ldab #222
	stab 0x1f
; 	 
; 	 
; 	 /*// set up the MDC interrupt for time_tick
; 	 HPRIO = 0xCC; 	   			 // elevate to highest priority
; 	 TSCR  = 0x00;				 // setup
; 	 MCCNT = 0x0000;   			 // modulus down-count start point
; 	 MCCTL = 0xC4;				 // enable
; 	 */
; 	 
; }
L3:
	.dbline 0 ; func end
	rts

