📄 adcutilities.a51
字号:
;*********************************************************************
; File name: ADCutilities.a51
;
; Copyright 2003 Texas Instruments, Inc. as an unpublished work.
; All Rights Reserved.
;
; Revision History . . .
; Version 1.0
;
; Assembler Version (Keil V2.38), (Raisonance V6.10.13)
;
; Module Description:
; ADC routines to read 24-bit ADC and return value as long integer.
;*********************************************************************
$include (legal.a51); Texas Instruments, Inc. copyright and liability
$include (reg1210.inc)
;*********************************************************************
PUBLIC unipolar, bipolar
adc_sub SEGMENT CODE
RSEG adc_sub
;;;;;;;;;;;;;;;;;;;;;
; unsigned long unipolar(void)
; return the 3 byte adres to R4567 (MSB~LSB)
; unsigned long int with R4=0
unipolar:
mov r4,#0
mov r5,adresh
mov r6,adresm
mov r7,adresl
ret
;;;;;;;;;;;;;;;;;;;;;
; signed long bipolar(void)
; return the 3 byte adres to R4567 (MSB~LSB)
; return signed long int with sign extendsion on R4
bipolar:
mov r4,#0
mov a,adresh
mov r5,a
mov r6,adresm
mov r7,adresl
jnb acc.7,positive
mov r4,#0ffh
positive:
ret
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -