MAX192
Low-Power, 8-Channel,
Serial 10-Bit ADC
22 ______________________________________________________________________________________
LDD #$0800
STD SPCR2 ;set ENDQP to $8 for 9 transfers
***** Initialize QSPI Command RAM *****
LDAA #$80 ;CONT=1,BITSE=0,DT=0,DSCK=0,PCS0=ACTIVE
STAA $FD40 ;store first byte in COMMAND RAM
LDAA #$C0 ;CONT=1,BITSE=1,DT=0,DSCK=0,PCS0=ACTIVE
STAA $FD41
STAA $FD42
STAA $FD43
STAA $FD44
STAA $FD45
STAA $FD46
STAA $FD47
LDAA #$40 ;CONT=0,BITSE=1,DT=0,DSCK=0,PCS0=ACTIVE
STAA $FD48
***** Initialize QSPI Transmit RAM *****
LDD #$008F
STD $FD20
LDD #$00CF
STD $FD22
LDD #$009F
STD $FD24
LDD #$00DF
STD $FD26
LDD #$00AF
STD $FD28
LDD #$00EF
STD $FD2A
LDD #$00BF
STD $FD2C
LDD #$00FF
STD $FD2E
LDD #$0000
STD $FD30
PULB
PULA
RTS
READ192:
;This routine triggers the QSPI microsequencer to autonomously
;trigger conversions on all 8 channels of the MAX192. Each
;conversion result is stored in the receive data RAM.
PSHA
LDAA #$80
ORAA SPCR1
STAA SPCR1 ;just set SPE
PULA
RTS
***** Interrupts/Exceptions *****
BDM: BGND ;exception vectors point here
;and put the user in background debug mode
Figure 20. MAX192 Assembly-Code Listing (continued)