?? fet140_dac12_03.s43
字號(hào):
;******************************************************************************
; MSP-FET430P140 Demo - DAC12.0 Output Voltage Ramp on P6.6
;
; Description; Using DAC12.0 and 2.5V ADC12REF reference with a gain of 1,
; ouput positive ramp on P6.6. Normal mode is LPM0 with CPU off. WDT used
; to provide ~0.5ms interrupt used to wake up the CPU and update the DAC
; with software. Use internal 2.5V Vref.
; ACLK = n/a, SMCLK = MCLK = WDTCLK = default DCO ~ 800kHz.
; //* MSP430F169 Device Required*//
;
; MSP430F169
; -----------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; | DAC0/P6.6|--> Ramp_positive
; | |
;
; M.Buccini
; Texas Instruments, Inc
; January 2004
;******************************************************************************
#include "msp430x16x.h"
;------------------------------------------------------------------------------
ORG 01100h ; Progam Start
;------------------------------------------------------------------------------
RESET mov.w #0A00h,SP ; Initialize 'x1x9 stackpointer
SetupWDT mov.w #WDT_MDLY_0_064,&WDTCTL ; WDT ~0.064ms interval timer
bis.b #WDTIE,&IE1 ; Enable WDT interrupt
SetupADC12 mov.w #REF2_5V+REFON,&ADC12CTL0 ; Internal 2.5V ref on
SetupDAC120 mov.w #DAC12IR+DAC12AMP_5+DAC12ENC,&DAC12_0CTL ; Int ref gain 1
;
Mainloop bis.w #CPUOFF+GIE,SR ; Enter LPM0, interrupts enabled
inc.w &DAC12_0DAT ; Positive ramp
and.w #0FFFh,&DAC12_0DAT ;
jmp Mainloop ;
;
;------------------------------------------------------------------------------
WDT_ISR ; Exit LPM0 on reti
;------------------------------------------------------------------------------
bic.w #CPUOFF,0(SP) ; TOS = clear LPM0
reti ;
;
;-----------------------------------------------------------------------------
; Interrupt Vectors Used MSP430x15x/16x
;-----------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFF4h ; WDT Vector
DW WDT_ISR ;
END
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -