slopad.s43
来自「MSP430F413的SlopAD代码」· S43 代码 · 共 52 行
S43
52 行
/******************************************************************************/
//File:SlopAD.s43
/*****************************************************************************/
#include "msp430x41x.h"
NAME SlopeAD
;====================================================
; SlopeAD
;====================================================
PUBLIC SlopeAD ; Declare symbol to be exported
RSEG CODE ; Code is relocated
SlopeAD
bis.b #02h,&P2OUT
mov #04096,R15 ; Integrate 1-bit DAC 4096 COUNTS
mov #00h,R14;
Pre_DisC bic.b #02h,&P2OUT ; Pre_Discharge to the voltage
dec R15 ;
jz MEAS_OVER
bit.b #CAOUT,&CACTL2 ;
jz Pre_DisC ;
Pre_C bis.b #02h,&P2OUT ; Pre_charge to the voltage
bit.b #CAOUT,&CACTL2 ;
jnz Pre_C ;
mov #04096,R15
Pluse bit.b #CAOUT,&CACTL2
jnc High1
Low1 bis.b #02h,&P2OUT ; charge
nop ; charge circle=discharge circle
dec R15
jnz Pluse
jmp MEAS_OVER
High1 bic.b #02h,&P2OUT ; discharge
inc R14 ;
dec R15 ;
jnz Pluse
MEAS_OVER mov R14,R12 ; return the result
bic.b #02h,&P2OUT
Ret
END
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?