English
Language : 

DAC8512 Datasheet, PDF (19/20 Pages) Analog Devices – % V, Serial Input Complete 12-Bit DAC
TFRLP
LDAA
0,X
Get a byte to transfer via SPI
STAA
SPDR
Write SDI data reg to start xfer
*
WAIT
LDAA
SPSR
Loop to wait for SPIF
BPL
WAIT
SPIF is the MSB of SPSR
*
(when SPIF is set, SPSR is negated)
INX
Increment counter to next byte for xfer
CPX
#SDI2+1
Are we done yet ?
BNE
TFRLP
If not, xfer the second byte
*
*Update DAC output with contents of DAC register
*
BCLR
PORTD,Y $20 Assert LD/
BSET
PORTD,Y $20 Latch DAC register
*
BSET
PORTC,Y $01 De-assert CS/
PULA When done, restore registers X, Y & A
PULY
PULX
RTS
** Return to Main Program **
DAC8512
REV. A
–19–