fet110_ca01.s43

来自「msp430p1110」· S43 代码 · 共 54 行

S43
54
字号
#include  "msp430x11x1.h"
;******************************************************************************
;   MSP-FET430x110 Demo - Comp_A Output Reference Voltages on P2.3 
;
;   Description; Output comparator_A reference levels on P2.3.  Program will 
;   cycle through the on-chip comparator_A reference voltages with output on 
;   P2.3. 
;   ACLK = n/a, MCLK = SMCLK = default DCO ~ 800k 
;
;		 MSP430F1121
;             -----------------
;         /|\|              XIN|-  
;          | |                 |
;          --|RST          XOUT|-
;            |                 |
;            |             P2.3|-->Vref
;            |                 |			 
;
;   M.Buccini
;   Texas Instruments, Inc
;   January 2002
;******************************************************************************
;------------------------------------------------------------------------------ 
            ORG     0F000h                  ; Program Start
;------------------------------------------------------------------------------ 
RESET       mov.w   #300h,SP                ; Initialize stackpointer
StopWDT     mov.w   #WDTPW+WDTHOLD,&WDTCTL  ; Stop WDT
            mov.b   #P2CA0,&CACTL2          ; P2.3 = CA0
            clr.w   R15                     ; Clear branch pointer
                                            ;
Mainloop    clr.b   &CACTL1                 ; No reference voltage
            call    #Delay                  ;
Ref1        mov.b   #CAREF0+CAON,&CACTL1    ; 0.25*Vcc on P2.3, Comp. on
            call    #Delay                  ;
Ref2        mov.b   #CAREF1+CAON,&CACTL1    ; 0.5*Vcc on P2.3, Comp. on
            call    #Delay                  ;
Ref3        mov.b   #CAREF1+CAREF0+CAON,&CACTL1     ; 0.55V on P2.3, Comp. on
            call    #Delay                  ;
            jmp     Mainloop                ;

Delay       mov.w   #00Fh,R15               ; Long Delay
            mov.w   #0,R14                  ;
Delay_1     dec.w   R14                     ;
            sbc.w   R15                     ;
            jnz     Delay_1                 ;
            ret                             ;
                                            ;
;------------------------------------------------------------------------------ 
;           Interrupt Vectors Used MSP430x11x1         
;------------------------------------------------------------------------------ 
            ORG     0FFFEh                  ; MSP430 RESET Vector
            DW      RESET                   ; 
            END

⌨️ 快捷键说明

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