adc_sub.a51
来自「TI 集成高性能24位A/D转换器的8052 核心单片机MSC1210 内置温度」· A51 代码 · 共 39 行
A51
39 行
; Texas Instruments
; Name: adc_sub.c
; Revision: 1.0
; Description: ADC conversion subroutines
$NOMOD51
$include (reg1210.inc)
PUBLIC bipolar ;, unipolar
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 a,AIE
; jnb acc.5,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 a,AIE
jnb acc.5,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 + =
减小字号Ctrl + -
显示快捷键?