⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fet440_lpm3.s43

📁 msp430f440的头程序
💻 S43
字号:
#include  "msp430x44x.h"
;******************************************************************************
;   MSP-FET430P440 Demo - FLL+ LPM3 Using BasicTimer ISR, 32kHz ACLK
;  
;   Description: System runs normally in LPM3 with basic timer clocked by 
;   32kHz ACLK. At a 2 second interval the basic timer ISR will wake the 
;   system and flash the LED on P5.1 inside of the Mainloop. If using
;   FET, must release JTAG on go, start, stop and restart application.
;   ACLK = LFXT1 = 32768, MCLK = SMCLK = DCO = 32xACLK = 1.48576MHz
;   //*An external watch crystal is required on XIN/XOUT for ACLK*//	  
;
;                MSP430F449
;             -----------------
;         /|\|              XIN|-  
;          | |                 | 32k
;          --|RST          XOUT|-
;            |                 |
;            |             P5.1|-->LED
;
;   M.Buccini
;   Texas Instruments, Inc
;   January 2002
;******************************************************************************
;------------------------------------------------------------------------------ 
            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+BTIP2+BTIP1+BTIP0,&BTCTL   ; 2s Int. 
            bis.b   #BTIE,&IE2              ; Enable Basic Timer interrupt        
SetupPx     mov.b   #0FFh,&P6DIR            ; P6.x output
            mov.b   #0FFh,&P5DIR            ; P5.x output
            mov.b   #0FFh,&P4DIR            ; P4.x output
            mov.b   #0FFh,&P3DIR            ; P3.x output
            mov.b   #0FFh,&P2DIR            ; P2.x output
            mov.b   #0FFh,&P1DIR            ; P1.x output
            eint                            ; Enable interrupts      
                                            ;				          							  
Mainloop    bis.w   #LPM3,SR                ; Remain in LPM3
            bis.b   #002h,&P5OUT            ; Set P5.1
            push    #2000                   ; Delay to TOS
Pulse       dec.w   0(SP)                   ; Decrement Value at TOS
            jnz     Pulse                   ; Delay done?
            incd.w  SP                      ; Clean-up stack
            bic.b   #002h,&P5OUT            ; Reset P5.1
            jmp     Mainloop                ;
                                            ;
;------------------------------------------------------------------------------
BT_ISR;     Exit LPM3 on reti
;------------------------------------------------------------------------------
            bic.w   #LPM3,0(SP)             ; 
            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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -