📄 实验8_思考_bt_1.s43
字号:
#include "msp430x44x.h"
;******************************************************************************
; MSP-Test44x Demo - Toggle P5.1 using ISR, DCO SMCLK
;
; Description; This program will toggle P5.1 by xor'ing P5.1 inside of
; a basic timer ISR. Default DCO used to clock basic timer.
; ACLK = LFXT1 = 32768, MCLK = SMCLK = default DCO ~ 800k
;
; MSP430F449
; -----------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; | P5.1|-->LED
;
;------------------------------------------------------------------------------
ORG 01100h ; Program Start
;------------------------------------------------------------------------------
RESET mov.w #0A00h,SP ; Initialize '449 stackpointer
Init_Sys mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupBT mov.b #BTSSEL+BTIP2+BTIP1+BTIP0,&BTCTL ; ~244us Int.
bis.b #BTIE,&IE2 ; Enable Basic Timer interrupt
SetupP5 bis.b #002h,&P5DIR ; P5.1 output
eint ; Enable interrupts
;
Mainloop bis.w #CPUOFF,SR ; CPU off
nop ; Required for C-spy
;
;------------------------------------------------------------------------------
BT_ISR; Toggle P5.1
;------------------------------------------------------------------------------
xor.b #002h,&P5OUT ; Toggle P5.1
reti ;
;
;-----------------------------------------------------------------------------
; Interrupt Vectors Used MSP430F44x
;-----------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFE0h ; BT Vector
DW BT_ISR ;
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -