|
在147上实现的例子:
#include "msp430x14x.h"
ORG 08000h ; Program Start
;=====================================================
Reset mov.w #00600h,SP ; Initialize '147 stackpointer
mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
call #Init
eint ; Ena××e interrupts
Mainloop bis.w #CPUOFF,SR ; CPU off
nop
;------------------------------------------------------------------------------
Init mov.w #TASSEL0+TACLR,&TACTL ; SMCLK, clear TAR
mov.w #CCIE,&CCTL0 ; CCR0 interrupt ena××ed
mov.w #16383,&CCR0
bis.w #MC0,&TACTL ; Start Timer_a in up mode
ret
;------------------------------------------------------------------------------
TA0_ISR nop
reti
;-----------------------------------------------------------------------------
;Interrupt Vectors Used MSP430F14x
;-----------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW Reset
ORG 0FFECh ; Timer_A0 Vector
DW TA0_ISR
END |
|