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

📄 实验4_wdt_定时.s43

📁 MSP-TEST44X 学习板光盘资料及实验说明 本学习板是按照教育大纲
💻 S43
字号:
#include  "msp430x44x.h"
;******************************************************************************
;   MSP-Test44x  Demo - P5.1 Interval overflow ISR, 32kHz ACLK 
;
;   Description; Toggle P5.1 using software timed by WDT ISR. Toggle rate is 
;   exactly 250ms based on 32kHz ACLK WDT clock source.  In this example the 
;   WDT is configured to divide 32768 watch-crystal(2^15) by 2^13 with an ISR 
;   triggered @ 4Hz.  
;   ACLK = LFXT1 = 32768, MCLK = SMCLK = DCO 
;   //*An external watch crystal on XIN XOUT is required for ACLK*//	  
;
;                 MSP430F449
;             -----------------
;         /|\|              XIN|-  
;          | |                 | 32kHz
;          --|RST          XOUT|-
;            |                 |
;            |             P5.1|-->LED
;
;  Yang Rui
;  Lierda, Inc
;  NOVEMBER 2003
;  Built with IAR Embedded Workbench Version: 1.26B
;------------------------------------------------------------------------------ 
            ORG     01100h                  ; Program Start
;------------------------------------------------------------------------------ 
RESET       mov.w   #0A00h,SP               ; Initialize '449 stackpointer
SetupFLL    bis.b   #XCAP14PF,&FLL_CTL0     ; Configure load caps
SetupWDT    mov.w   #WDT_ADLY_250,&WDTCTL   ; WDT 250ms, ACLK, interval timer 
            bis.b   #WDTIE,&IE1             ; Enable WDT 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
                                            ;
;------------------------------------------------------------------------------
WDT_ISR;    Toggle P5.1
;------------------------------------------------------------------------------
            xor.b   #002h,&P5OUT            ; Toggle P5.1
            reti                            ;		 
                                            ;   
;----------------------------------------------------------------------------- 
;           Interrupt Vectors Used MSP430F44x          
;----------------------------------------------------------------------------- 
            ORG     0FFFEh                  ; MSP430 RESET Vector
            DW      RESET                   ; 
            ORG     0FFF4h                  ; WDT Vector
            DW      WDT_ISR                 ; 
            END

⌨️ 快捷键说明

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