?? fet430_oa_02.s43
字號:
;******************************************************************************
; MSP-FET430P430 Demo - OA0, Comparator in General-Purpose Mode
;
; Description: Use OA0 as a comparator in general-purpose mode. In this
; example, OA0 is configured for general-purpose mode, but used as a
; comparator. The reference is supplied by DAC12_0 on the "-" input.
; The "+" terminal is connected to OA0I0.
; ACLK = n/a, MCLK = SMCLK = default DCO
;
; MSP430FG439
; -------------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; "+" -->|P6.0/OA0I0 |
; | |
; | P6.1/OA0O|--> OA0 Output
; | | Output goes high when
; | | Input > 1.5V
;
; M. Mitchell
; Texas Instruments Inc.
; Feb 2005
; Built with IAR Embedded Workbench Version: 3.21A
;******************************************************************************
#include <msp430xG43x.h>
;------------------------------------------------------------------------------
ORG 01100h ; Program Start
;------------------------------------------------------------------------------
RESET mov.w #0A00h,SP ; Initialize stack pointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
;
REFOn mov.w #REFON+REF2_5V,&ADC12CTL0
; 2.5V reference for DAC12
DAC12_0 mov.w #DAC12IR+DAC12AMP_2+DAC12ENC,&DAC12_0CTL
; 1x input range, enable DAC120,
; low speed/current
mov.w #099Ah,&DAC12_0DAT ; Set DAC120 to output 1.5V
;
SetupOA mov.b #OAN_2+OAPM_1,&OA0CTL0 ; "-" connected to DAC120,
; "+" connected to OA0I0 (default),
; slow slew rate
mov.b #OARRIP,&OA0CTL1 ; General purpose (default),
; limited range (see datasheet)
;
Mainloop bis.w #LPM3,SR ; Enter LPM3
nop ; Required only for debug
;
;------------------------------------------------------------------------------
; Interrupt Vectors
;------------------------------------------------------------------------------
ORG 0FFFEh ; RESET Vector
DW RESET ;
END
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -