At89c2051 Successive Approximation A-to-D conversion
NAME SA_ADC_Test
; Test program to loop on Successive Approximation A-to-D conversion.
; Allows digital codes and resulting DAC output to be viewed on "scope.
DSEG AT 0020H
ORG 0060H ; stack origin
stack: DS 0020H ; stack depth
CSEG
ORG 0000H ; power on/reset vector
jmp on_reset
ORG 0003H ; external interrupt 0 vector
reti ; undefined
ORG 000BH ; timer 0 overflow vector
reti ; undefined
ORG 0013H ; external interrupt 1 vector
reti ; undefined
ORG 001BH ; timer 1 overflow vector
reti ; undefined
ORG 0023H ; serial I/O interrupt vector
reti ; undefined
ORG 0040H ; begin constant data space
ORG 0080H ; begin code space
USING 0 ; register bank zero
on_reset:
mov sp, #(stack-1) ; initialize stack pointer
mov IE, #0 ; deactivate all interrupts
mov a, #0ffh ; deactivate output ports
mov p1, a ;
mov p3, a ;
本新闻共4页,当前在第1页 [1] [2] [3] [4]
|