
20
LTC1594/LTC1598
15948fb
TYPICAL APPLICATIONS N
U
LDA #$52
Configuration data for serial peripheral
control register (Interrupts disabled, output
enabled, master, Norm = 0, Ph = 0, Clk/16)
STA $0A
Load configuration data into location $0A (SPCR)
LDA #$FF
Configuration data for I/O ports
(all bits are set as outputs)
STA $04
Load configuration data into Port A DDR ($04)
STA $05
Load configuration data into Port B DDR ($05)
STA $06
Load configuration data into Port C DDR ($06)
LDA #$08
Put DIN word for LTC1598 into Accumulator
(CH0 with respect to GND)
STA $50
Load DIN word into memory location $50
START BSET 0,$02
Bit 0 Port C ($02) goes high (CS goes high)
LDA $50
Load DIN word at $50 into Accumulator
STA $0C
Load DIN word into SPI data register ($0C) and
start clocking data
LOOP1 TST $0B
Test status of SPIF bit in SPI status register ($0B)
MC68HC05 CODE
BPL LOOP1 Loop if not done with transfer to previous instruction
BCLR 0,$02
Bit 0 Port C ($02) goes low (CS goes low)
LDA $0C
Load contents of SPI data register into Accumulator
STA $0C
Start next SPI cycle
LOOP2 TST $0B
Test status of SPIF
BPL LOOP2 Loop if not done
LDA $0C
Load contents of SPI data register into Accumulator
STA $0C
Start next SPI cycle
AND #$IF
Clear 3 MSBs of first DOUT word
STA $00
Load Port A ($00) with MSBs
LOOP3 TST $0B
Test status of SPIF
BPL LOOP3 Loop if not done
LDA $0C
Load contents of SPI data register into Accumulator
AND #$FE
Clear LSB of second DOUT word
STA $01
Load Port B ($01) with LSBs
JMP START Go back to start and repeat program
1594/98 TA04
DOUT FROM LTC1598 STORED IN MC68HC05 RAM
B1
B0
0
B2
B3
B5
B6
B4
0
LSB
MSB
#00
#01
0
B11
B10
B9
B8
B7
CLK
DIN
CSMUX
CSADC
ANALOG
INPUTS
C0
SCK
MC68HC05
DOUT
MOSI
LTC1598
BYTE 1
BYTE 2
MISO
Hardware and Software Interface to Motorola MC68HC05
Data Exchange Between LTC1598 and MC68HC05
CSMUX
= CSADC
= CS
CLK
DOUT
MPU
RECEIVED
WORD
1594/98 TA03
B3
B7
B6
B5
B4
B2
B1
B0
B1
B2
B11
B10
B9
B8
DIN
MPU
TRANSMIT
WORD
BYTE 3
BYTE 2
EN
D2
0D1
X
D0
BYTE 1
X
00
0
X
XX
X
BYTE 3
BYTE 2
BYTE 1
B10
?
0
B11
B9
B7
B8
B6
B5
B3
B4
B2
B1
B0
DON‘T CARE
D1
D2
?
??
?
??
?
DO
EN