实验8_思考_bt_2.s43

来自「msp430系列开发板源代码」· S43 代码 · 共 47 行

S43
47
字号
#include  "msp430x44x.h"
;******************************************************************************
;   MSP-Test44x Demo - BasicTimer Toggle P5.1 using ISR, 32kHz ACLK 
;
;   Description; This program will toggle P5.1 by xor'ing P5.1 inside of
;   a basic timer ISR.  ACLK used to clock basic timer. 
;   ACLK = LFXT1 = 32768, MCLK = SMCLK = DCO =32xACLK = 1.048576MHz
;   //*An external watch crystal on XIN XOUT is required for ACLK*//	  
;
;                MSP430F449
;             -----------------
;         /|\|              XIN|-  
;          | |                 | 32k
;          --|RST          XOUT|-
;            |                 |
;            |             P5.1|-->LED
;

;------------------------------------------------------------------------------
            ORG     01100h                  ; Program Start
;------------------------------------------------------------------------------
RESET       mov.w   #0A00h,SP               ; Initialize '449 stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
SetupFLL    bis.b   #XCAP14PF,&FLL_CTL0     ; Configure load caps
SetupBT     mov.b   #BTDIV+BTIP1+BTIP0,&BTCTL   ; 125ms Int. 
            bis.b   #BTIE,&IE2              ; Enable Basic Timer interrupt        
SetupP5     bis.b   #002h,&P5DIR            ; P5.1 output
            eint                            ; Enable interrupts      
                                            ;						  
Mainloop    bis.w   #LPM3,SR                ; Remain in LPM3
            nop                             ; Required only for C-spy
                                            ;
;------------------------------------------------------------------------------
BT_ISR;     Toggle P5.1
;------------------------------------------------------------------------------
            xor.b   #002h,&P5OUT            ; Toggle P5.1
            reti                            ;		 
                                            ;   
;----------------------------------------------------------------------------- 
;           Interrupt Vectors Used MSP430x44x         
;----------------------------------------------------------------------------- 
            ORG     0FFFEh                  ; MSP430 RESET Vector
            DW      RESET                   ; 
            ORG     0FFE0h                  ; BT Vector
            DW      BT_ISR                  ; 
            END     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?