fet140_rosc.s43

来自「基于IAR Workbench for MSP430 的汇编语言例程」· S43 代码 · 共 47 行

S43
47
字号
;******************************************************************************
;   MSP-FET430P140 Demo - DCOCLK Biased with External Resistor Rosc
;     
;   Description; Use external resistor on P2.5 as DCO current source. DCOCLK 
;   is used by default as the MCLK source. Mainloop drives a 10 cycle software 
;   loop toggling P1.1. Measure DCOCLK/10 on P1.1. Example also disables XTAL 
;   buffer. Use of external resistor reduces temperature sensitivity of DCOCLK.
;
;   DCOCLK = Using default DCO and RSEL values @ 2.85V
;   022k ~ 5.5MHz
;   100k ~ 2Mhz
;   220k ~ 860kHz
;   470k ~ 400kHz
;
;                MSP430F149
;             -----------------
;    /|\  /|\|              XIN|-  
;     |    | |                 | 
;     R    --|RST          XOUT|-
;     |      |                 |
;     -------|P2.5/ROSC    P1.1|-->DCOCLK/10
;
;   M.Buccini
;   Texas Instruments, Inc
;   January 2004
;******************************************************************************
#include  "msp430x14x.h"
;------------------------------------------------------------------------------ 
            ORG     01100h                  ; Progam Start 
;------------------------------------------------------------------------------ 
RESET       mov.w   #0A00h,SP               ; Initialize 'X1x9 stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
SetupBC     bis.b   #DCOR,&BCSCTL2          ; Rosc 
            bis.w   #OSCOFF,SR              ; XTAL not used
            bis.b   #002h,&P1DIR            ; P1.1 = output direction
                                            ;           
Mainloop    bis.b   #002h,&P1OUT            ; P1.1 = 1
            bic.b   #002h,&P1OUT            ; P1.1 = 0
            jmp     Mainloop                ; Repeat
                                            ;
;------------------------------------------------------------------------------ 
;           Interrupt Vectors Used MSP430x13x/14x/15X/16X        
;------------------------------------------------------------------------------ 
            ORG     0FFFEh                  ; MSP430 RESET Vector
            DW      RESET                   ; 
            END     

⌨️ 快捷键说明

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