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