.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 ; // 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 79003E clr 0x3e 0003 ; 0003 ; 0003 ; // set up the RTI INTERRUPT 0003 ; INTR_OFF(); // disable/mask all maskable interrupts 0003 1410 sei 0005 0005 ; RTICTL = 0x86; // enable RTI at 65.536 miliseconds 0005 C686 ldab #134 0007 7B0014 stab 0x14 000A ; //RTICTL = 0x85; // enable RTI at 32.768 miliseconds 000A ; RTIFLG = 0x80; // clear real time interrupt flag 000A C680 ldab #128 000C 7B0015 stab 0x15 000F ; 000F ; 000F ; // set up the COP WATCHDOG clock monitor for 524.288 ms 000F ; COPCTL = 0xC5; // COP on 000F C6C5 ldab #197 0011 7B0016 stab 0x16 0014 ; //COPCTL = 0x00; // COP off 0014 ; 0014 ; 0014 ; // set up the TOF interrupt 0014 ; TMSK2 = 0x80; // set to interrupt at 16.384 miliseconds 0014 C680 ldab #128 0016 7B008D stab 0x8d 0019 ; TSCR = 0x80; // enable the timer 0019 C680 ldab #128 001B 7B0086 stab 0x86 001E ; PACTL |= 0x0C; // ensure the timer is clocked from mclock divider 001E 1C00A00C bset 0xa0,#12 0022 ; HPRIO = 0xDE; // elevate the TOF interrupt 0022 C6DE ldab #222 0024 7B001F stab 0x1f 0027 ; 0027 ; 0027 ; /*// set up the MDC interrupt for time_tick 0027 ; HPRIO = 0xCC; // elevate to highest priority 0027 ; TSCR = 0x00; // setup 0027 ; MCCNT = 0x0000; // modulus down-count start point 0027 ; MCCTL = 0xC4; // enable 0027 ; */ 0027 ; } 0027 L3: 0027 .dbline 0 ; func end 0027 3D rts