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

📄 fet440_adc12_07.s43

📁 msp430f440的头程序
💻 S43
字号:
#include          "msp430x44x.h" // Standard Equations
;******************************************************************************
;   MSP-FET430P440 Demo - ADC12, Single Conversion on Single Channel
;
;   Description: This program will show how to perform a single conversion
;                on a single channel
;
;   This example shows how to perform a single ADC12 conversion on a single
;   channel. It uses AVcc for the reference and performs a single conversion on 
;   Channel A0. The conversion results are stored in ADC12MEM0 and are moved to 
;   R5 after the convserion is complete. Test by applying a voltage to channel 
;   A0, then setting and running to a break point at "jmp Mainloop."  To view 
;   the conversion results, open a register window in C-Spy and view the 
;   contents of R5.
;
;
;                MSP430F449
;              ---------------
;             |               |
;             |      A0 (P6.0)|<---- Vin
;             |               |
;
;
;       M.Mitchell
;       Texas Instruments, Inc
;       January, 2002
;******************************************************************************
;------------------------------------------------------------------------------ 
main        ORG     01100h                  ; Program Start
;------------------------------------------------------------------------------ 
RESET       mov     #0A00h,SP               ; Initialize stackpointer
StopWDT     mov     #WDTPW+WDTHOLD,&WDTCTL  ; Stop watchdog
            bis.b   #BIT0,&P6SEL            ; Enable A/D channel A0
                                            ;
SetupADC12  mov     #ADC12ON+SHT0_2,&ADC12CTL0 ; Turn on ADC12, set samp. time
            mov     #SHP,&ADC12CTL1         ; Use sampling timer    
            bis     #ENC,&ADC12CTL0         ; Enable conversions
                                            ;            
Mainloop    bis     #ADC12SC,&ADC12CTL0     ; Start conversions
testIFG     bit     #BIT0,&ADC12IFG         ; Conversion done?
            jz      testIFG                 ; No, test again
            mov     &ADC12MEM0,R5           ; Move result
            jmp     Mainloop                ; SET BREAKPOINT HERE
                                            ;
;------------------------------------------------------------------------------ 
;           Interrupt Vectors        
;------------------------------------------------------------------------------
            ORG     0FFFEh                  ; MSP430 RESET Vector
            DW      RESET                   ;
            END     

⌨️ 快捷键说明

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