SES APPLIC-37 Manual Del Usuario página 90

Tabla de contenido
Appendix
;APPLIC37 analog A51 sample routines
;
;DAC1 routine outputs the accumulator contents to the analog output channel 1
;DAC2 routine outputs the accumulator contents to the analog output channel 2
;
;ADC routine reads one of the analog channels (according to the accumulator
contents(
;and returns the analog channel value in the accumulator
;
--------------
;
;Hardware Handling
;
DAC_SYNC
EQU
SER_CLK
EQU
SER_DI
EQU
SER_DO
EQU
ADC_CS
EQU
;SARS
EQU
;
;
-----------
-
;
;
DAC1 ROUTINE
;
INPUT :
;
OUTPUT :
;
CALLS:
SDAC
;
USES:
------------
;
DAC1: PUSH
ACC
CLR
SER_CLK;
CLR
DAC_SYNC
;
MOV
A,#03H
LCALL SDAC
;
POP
ACC
LCALL SDAC
;
SETB
DAC_SYNC
RET;
;
------------
;
;
DAC2 ROUTINE
;
INPUT :
;
OUTPUT :
;
CALLS:
;
USES:
------------
;
DAC2: PUSH
ACC
CLR
SER_CLK;
CLR
DAC_SYNC
;
MOV
A,#07H
A
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
A = Value for DAC1
none
A
;clear SYNC
;setup DAC 1
;send to the DAC
;send to the DAC
;STROBE DATA OUT
A = Value for DAC2
none
SDAC
A
;clear SYNC
;setup DAC 2
87
SES Scientific Educational Systems
Tabla de contenido
loading

Tabla de contenido