English
Language : 

AD420ANZ-32 Datasheet, PDF (12/16 Pages) Analog Devices – Serial Input 16-Bit 4 mA–20 mA, 0 mA–20 mA DAC
AD420
MICROPROCESSOR INTERFACE
AD420-TO-MC68HC11 (SPI BUS) INTERFACE
The AD420 interface to the Motorola serial peripheral interface
(SPI) is shown in Figure 11. The MOSI, SCK, and SS pins of the
HC11 are respectively connected to the DATA IN, CLOCK, and
LATCH pins of the AD420. The majority of the interfacing
issues are done in the software initialization. A typical routine,
such as the one shown below, begins by initializing the state of
the various SPI data and control registers.
INIT
NEXTPT
SENDAT
WAIT1
WAIT2
LDAA
STAA
LDAA
STAA
LDAA
STAA
LDAA
BSR
JMP
LDY
BCLR
STAA
LDAA
BPL
LDAA
STAA
LDAA
BPL
BSET
RTS
#$2F
PORTD
#$38
DDRD
#$50
SPCR
MSBY
SENDAT
NEXTPT
#$1000
$08,Y,$20
SPDR
SPSR
WAIT1
LSBY
SPDR
SPSR
WAIT2;
$08,Y,$20
; SS = 1; SCK = 0;
MOSI = 1
;SEND TO SPI OUTPUTS
; SS, SCK, MOSI =
OUTPUTS
;SEND DATA DIRECTION
INFO
;DABL INTRPTS, SPI
IS MASTER & ON
;CPOL = 0, CPHA = 0,
1MHZ BAUDRATE
;LOAD ACCUM W/UPPER
8 BITS
;JUMP TO DAC OUTPUT
ROUTINE
;INFINITE LOOP
;POINT AT ON-CHIP
REGISTERS
;DRIVE SS (LATCH)
LOW
;SEND MS-BYTE TO SPI
DATA REG
;CHECK STATUS OF
SPIE
;POLL FOR END OF X-
MISSION
;GET LOW 8 BITS FROM
MEMORY
;SEND LS-BYTE TO SPI
DATA REG
;CHECK STATUS OF
SPIE
;POLL FOR END OF X-
MISSION
;DRIVE SS HIGH TO
LATCH DATA
The SPI data port is configured to process data in 8-bit bytes.
The most significant data byte (MSBY) is retrieved from
memory and processed by the SENDAT routine. The SS pin is
driven low by indexing into the PORTD data register and clear
Bit 5. The MSBY is then sent to the SPI data register where it is
automatically transferred to the AD420 internal shift resister.
The HC11 generates the requisite eight clock pulses with data
valid on the rising edges. After the MSBY is transmitted, the
least significant byte (LSBY) is loaded from memory and
transmitted in a similar fashion. To complete the transfer, the
LATCH pin is driven high when loading the complete 16-bit
word into the AD420.
MOSI
68HC11 SCK
SS
DATA IN
CLOCK AD420
LATCH
Figure 11. AD420-to-68HC11 (SPI) Interface
AD420 TO MICROWIRE INTERFACE
The flexible serial interface of the AD420 is also compatible
with the National Semiconductor MICROWIRE interface. The
MICROWIRE interface is used in microcontrollers such as the
COP400 and COP800 series of processors. A generic interface
to use the MICROWIRE interface is shown in Figure 12. The
G1, SK, and SO pins of the MICROWIRE interface are
respectively connected to the LATCH, CLOCK, and DATA IN
pins of the AD420.
SO
MICROWIRE
SK
G1
DATA IN
CLOCK AD420
LATCH
Figure 12. AD420-to-MICROWIRE Interface
Rev. H | Page 12 of 16