LTC1402
U
W U U
APPLICATIONS INFORMATION
* This is an example of how to initialize the Buffered Serial Port (BSP).
* The BSP is initialized to require an external CLK and FSX for
* operation. The data format is 16-bits, burst mode, with autobuffering
* enabled.
*
*
*****************************************************************************************************
*Timing at BSP pins in DSKPLUS TMS320c542 board with inverters at BCLKR and BFSR.
*
*BFSR Pin JP1-20 ~\___/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\___/~~~~~~~~~~*
*BCLKR Pin JP1-14 _/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/~\_/
*BDR Pin JP1-26 -_—_—<REF-B11-B10-B09-B08-B07-B06-B05-B04-B03-B02-B01-B00>—_—_—<REF-B11-
*CLKIN Pin JP5-09 ~~~~~\_______/~~~~~~~\_______/~~~~~~~\_______/~~~~~~~\_______/~~~~~~~\_______/~~~~
*
*A 2 place right shift is needed to right justify the input data.
*The REF bit is also be masked in this example
*
*
*
*
*
*
*****************************************************************************************************
*
Loopback
Format
IntSync
.set NO
.set BIT_16
.set NO
;(digital looback mode?)
DLB bit
FO bit
TXM bit
MCM bit
;(Data format? 16,12,10,8)
;(internal Frame syncs generated?)
;(internal clks generated?)
IntCLK
.set NO
BurstMode
CLKDIV
PCM_Mode
FS_polarity
CLK_polarity .set YES
Frame_ignore .set !YES
XMTautobuf .set NO
.set YES
;(if BurstMode=NO, then Continuous) FSM bit
;(3=default value, 1/4 CLOCKOUT)
;(Turn on PCM mode?)
;(change polarity)YES=^^^\_/^^^, NO=___/^\___
;(change polarity)for BCLKR YES=_/^, NO=~\_
;(inverted !YES -ignores frame)
;(transmit autobuffering)
.set
3
.set NO
.set NO
RCVautobuf
XMThalt
RCVhalt
XMTbufAddr .set 0x800
XMTbufSize .set 0x000
RCVbufAddr .set 0x800
.set YES
.set NO
.set NO
;(receive autobuffering)
;(transmit buff halt if XMT buff is full)
;(receive buff halt if RCV buff is full)
;(address of transmit buffer)
;(length of transmit buffer)
;(address of receive buffer)
RCVbufSize
.set 0x800
;(length of receive buffer)works up to 800
*
*
*
**********************************************************************
.eval ((Loopback >> 1)|((Format & 2)<<1)|(BurstMode <<3)|(IntCLK <<4)|(IntSync <<5)) ,SPCval
.eval ((CLKDIV)|(FS_polarity <<5)|(CLK_polarity<<6)|((Format & 1)<<7)|(Frame_ignore<<8)|(PCM_Mode<<9)), SPCEval
.eval (SPCEval|(XMTautobuf<<10)|(XMThalt<<12)|(RCVautobuf<<13)|(RCVhalt<<15)), SPCEval
sineinit:
bspc = #SPCval
ifr = #10h
; places buffered serial port in reset
; clear interrupt flags
imr = #210h
intm = 0
; Enable HPINT,enable BRINT0
; all unmasked interrupts are enabled.
; programs BSPCE and ABU
; initializes transmit buffer start address
; initializes transmit buffer size
; initializes receive buffer start address
; initializes receive buffer size
; bring buffered serial port out of reset
;for transmit and receive because GO=0xC0
;clear a chunk at the end to mark the end
bspce = #SPCEval
axr = #XMTbufAddr
bkx = #XMTbufSize
arr = #RCVbufAddr
bkr = #RCVbufSize
bspc = #(SPCval | GO)
return
.space 16*32
;======================================================================
;
; VECTORS
;
;======================================================================
.sect “vectors”
;The vectors start here
;get BSP vectors
; ***************************************************************************
;
;
;
Vector Table for the ‘C54x DSKplus
BSP vectors and Debugger vectors
TDM vectors just return
; ***************************************************************************
20