LTC1400
U
TYPICAL APPLICATIO S
TMS320C50 Code for Circuit
THIS PROGRAM DEMONSTRATES LTC1400 INTERFACE TO TMS320C50
FRAME SYNC PULSE IS GENERATED FROM TFSX
*Start Serial Communication*
SACL TDXR
SPLK #040h, IMR
CLRC INTM
; Generate frame sync pulse
; Turn on TRNT receiver interrupt
; Enable interrupt
*Initialization*
.mmregs
; Defines global symbolic names
CLRC SXM
; For Unipolar input, set for right shift
;- - Initialized data memory to zero
; with no sign extension
; Load the auxiliary register pointer with seven
.ds
0F00h
; Initialize data to zero
MAR *AR7
DATA0
DATA1
DATA2
DATA3
DATA4
DATA5
.word
.word
.word
.word
.word
.word
0
0
0
0
0
0
; Begin sample data location
; .
; Location of data
; .
LAR AR7, #0F00h
; Load the auxiliary register seven with #0F00h
; as the begin address for data storage
WAIT: NOP
NOP
; Wait for a receive interrupt
;
;
; .
NOP
; End sample data location
SACL TDXR
; !! regenerate the frame sync pulse
;
;- - Set up the ISR vector
B
WAIT
.ps
B
080Ah
; Serial ports interrupts
; - - - - - - - end of main program - - - - - - - - - - ;
rint :
xint :
trnt :
txnt :
RECEIVE
TRANSMIT
TREC
; 0A;
; 0C;
; 0E;
; 10;
B
*Receiver Interrupt Service Routine*
TREC:
B
B
TTRANX
LAMM TRCV
SFR
SFR
; Load the data received from LTC1400
; Shift right two times
;
;- - Setup the reset vector
.ps 0A00h
.entry
START:
AND #1FFFh, 0
; ANDed with #1FFFh
; For converting the data to right
; justified format
*TMS32C050 Initialization*
SETC INTM
; Temporarily disable all interrupts
; Set data page pointer to zero
;
LDP #0
SACL *+, 0
; Write to data memory pointed by AR7 and
; increase the memory address by one
;
OPL #0834h, PMST ; Set up the PMST status and control register
LACC #0
LACC AR7
SUB #0F05h,0
SAMMCWSR
SAMMPDWSR
; Set software wait state to 0
;
; Compare to end sample address #0F05h
BCND END_TRCV, GEQ ; If the end sample address has exceeded jump
to END_TRCV
;
; Else Re-enable the TRNT receive interrupt
; Return to main program and enable interrupt
*Configure Serial Port*
SPLK #0038h, TSPC ; Set TDM Serial Port
SPLK #040h, IMR
RETE
; TDM = 0 Stand Alone mode
; DLB = 0 Not loop back
; FO = 0 16 Bits
*After Obtained the Data from LTC1400, Program Jump to END_TRCV*
END_TRCV:
; FSM = 1 Burst Mode
; MCM = 1 CLKX is generated internally
; TXM = 1 FSX as output pin
; Put serial port into reset
; (XRST = RRST =0)
SPLK #002h, IMR
CLRC INTM
; Enable INT2 for program to halt
SUCCESS:
SUCCESS
B
SPLK #00F8h, TSPC ; Take Serial Port out of reset
; (XRST = RRST = 1)
SPLK #0FFFFh, IFR ; Clear all the pending interrupts
*Fill the Unused Interrupt with RETE, to avoid program get “lost”*
TTRANX:
RETE
RECEIVE:
RETE
TRANSMIT:
RETE
INT2:
B halt
; Halts the running CPU
1400fa
15