共2条
1/1 1 跳转至页
AD AD转换采用序列多次采样模式,怎么停止呢?(请看下面的程序)
问
#include "MSP430xG43x.h" // Standard Equations
;
Results EQU 0200h ; Begining of Results table
;
;------------------------------------------------------------------------------
main ORG 01100h ; Program Start
;------------------------------------------------------------------------------
RESET mov #0A00h,SP ; Initialize stack pointer
StopWDT mov #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog
bis.b #BIT0,&P6SEL ; Enable A/D channel A0
;
SetupADC12 mov #SHT0_8+MSC+ADC12ON,&ADC12CTL0
; Turn on ADC12, use int. osc.
; Extend sampling period to avoid
; overflow
; Set MSC so conversions triggered
; automatically
mov #SHP+CONSEQ_2,&ADC12CTL1
; Use sampling timer, set mode
mov #BIT0,&ADC12IE ; Enable ADC12IFG.0 for ADC12MEM0
eint ; Enable interrupts
clr R5 ; Clear results table pointer
;
Mainloop bis #ENC,&ADC12CTL0 ; Enable conversions
bis #ADC12SC,&ADC12CTL0 ; Start conversions
bis #CPUOFF,SR ; Hold in LPM0
nop ; Need only for C-SPY
;
;------------------------------------------------------------------------------
ADC12ISR ; Interrupt Service Routine for ADC12
;------------------------------------------------------------------------------
mov &ADC12MEM0,Results(R5) ; Move result, IFG is reset
incd R5 ; Increment results table pointer
and #0Eh,R5 ; Modulo pointer
reti ;
;
;------------------------------------------------------------------------------
不明白一点,每次都是中断,中断完了以后就进入低功耗,那这种中断什么时候才是个结束呢?
请指点。谢谢
; Interrupt Vectors
;------------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFEEh ; ADC12 Interrupt Vector
DW ADC12ISR ;
END
;
Results EQU 0200h ; Begining of Results table
;
;------------------------------------------------------------------------------
main ORG 01100h ; Program Start
;------------------------------------------------------------------------------
RESET mov #0A00h,SP ; Initialize stack pointer
StopWDT mov #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog
bis.b #BIT0,&P6SEL ; Enable A/D channel A0
;
SetupADC12 mov #SHT0_8+MSC+ADC12ON,&ADC12CTL0
; Turn on ADC12, use int. osc.
; Extend sampling period to avoid
; overflow
; Set MSC so conversions triggered
; automatically
mov #SHP+CONSEQ_2,&ADC12CTL1
; Use sampling timer, set mode
mov #BIT0,&ADC12IE ; Enable ADC12IFG.0 for ADC12MEM0
eint ; Enable interrupts
clr R5 ; Clear results table pointer
;
Mainloop bis #ENC,&ADC12CTL0 ; Enable conversions
bis #ADC12SC,&ADC12CTL0 ; Start conversions
bis #CPUOFF,SR ; Hold in LPM0
nop ; Need only for C-SPY
;
;------------------------------------------------------------------------------
ADC12ISR ; Interrupt Service Routine for ADC12
;------------------------------------------------------------------------------
mov &ADC12MEM0,Results(R5) ; Move result, IFG is reset
incd R5 ; Increment results table pointer
and #0Eh,R5 ; Modulo pointer
reti ;
;
;------------------------------------------------------------------------------
不明白一点,每次都是中断,中断完了以后就进入低功耗,那这种中断什么时候才是个结束呢?
请指点。谢谢
; Interrupt Vectors
;------------------------------------------------------------------------------
ORG 0FFFEh ; MSP430 RESET Vector
DW RESET ;
ORG 0FFEEh ; ADC12 Interrupt Vector
DW ADC12ISR ;
END
共2条
1/1 1 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| 基于MCP23S17的输入输出功能模块控制被打赏¥20元 | |
| 【S32K3XX】SPD 软件包使用Link文件修改被打赏¥22元 | |
| Switch-Case局部变量定义问题被打赏¥23元 | |
| 基于米尔TIAM62L开发板的串口通信及应用被打赏¥20元 | |
| PCF8574功能模块及其使用被打赏¥20元 | |
| 传感器LSM6DSO及LIS3MDL的功能检测被打赏¥18元 | |
| LPS25HB气压传感器及其检测被打赏¥18元 | |
| HTS221温湿度传感器及其检测被打赏¥18元 | |
| 【S32K3XX】HSE FW 版本更新被打赏¥21元 | |
| 基于ArduinoUNO开发板的AT24C02读写测试被打赏¥16元 | |
我要赚赏金
