Datasheet
DAC8512
–19–
REV. A
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 **