19
LTC1402
APPLICATIONS INFORMATION
WUU
U
; ***************************************************************************
; Files: BSP2KB.ASM ->
; 2kbyte collection into DSKPlus TMS320C542 with Serial Port interface to LTC1402
; first element at 1024, last element at 1023, two middle elements at 2047 and 0000
; bipolar mode
; ***************************************************************************
.width 160
.length 110
.title “sineb0 BSP in auto buffer mode”
.mmregs
.setsect “.text”, 0x500,0 ;Set address of executable
.setsect “vectors”, 0x180,0 ;Set address of incoming 1402 data
.setsect “buffer”, 0x800,0 ;Set address of BSP buffer for clearing
.setsect “result”, 0x1800,0 ;Set address of result for clearing
.text ;.text marks start of code
start: ;Make sure /PWRDWN is low at J1-9 to turn off AC01 adc
tim=#0fh
prd=#0fh
tcr = #10h ; stop timer
tspc = #0h ; stop TDM serial port to AC01
pmst = #01a0h ; set up iptr. Processor Mode STatus register
sp = #0700h ; init stack pointer.
dp = #0 ; data page
ar2 = #1800h ; pointer to computed receive buffer.
ar3 = #0800h ; pointer to Buffered Serial Port receive buffer
ar4 = #0h ; reset record counter
call sineinit ; Double clutch the initialization to insure a proper
sinepeek: ; insert debugger break here to view results
call sineinit ; reset. The external frame sync must occur 2.5 clocks
; or more after the port comes out of reset.
wait goto wait
; ————————Buffered Receive Interrupt Routine —————————
breceive:
ifr = #10h ; clear interrupt flags
TC = bitf(@BSPCE,#4000h) ; check which half (bspce(bit14)) of buffer
if (NTC) goto bufull ; if this still the first half get next half
bspce = #(2023h + 08000h) ; turn on halt for second half (bspce(bit15))
return_enable
; ———————mask and shift input data after 2k buffer is full——-
bufull:
b = *ar3+ << -2 ; load acc b with BSP buffer and shift right 2
b = #00FFFh & b ; mask out the REF bit and the 3 other tristate bits
b = #00800h ^ b ; invert BIPOLAR MSB. Comment this line in UNIPOLAR mode
*ar2+ = data(#0bh) ; store B to out buffer and advance AR2 pointer
TC = (@ar2 == #02000h) ; output buffer is 2k starting at 1800h
if (TC) goto start ; restart if out buffer is at 1fffh
goto bufull
; —————————dummy bsend return————————————
bsend return_enable ;this is a dummy return to define bsend
;in vector table below
; ——————————— end ISR ——————————————
;initialize buffered serial port
**********************************************************************
* BSP initialization code for the ‘C54x DSKplus *
* for use with 1402 in standard mode *
* BSPC and SPC are the same in the ‘C542 *
**********************************************************************
ON .set 1
OFF .set !ON
YES .set 1
NO .set !YES
BIT_8 .set 2
BIT_10 .set 1
BIT_12 .set 3
BIT_16 .set 0
GO .set 0x80
**********************************************************************
20
LTC1402
APPLICATIONS INFORMATION
WUU
U
* 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 .set NO ;(digital looback mode?) DLB bit
Format .set BIT_16 ;(Data format? 16,12,10,8) FO bit
IntSync .set NO ;(internal Frame syncs generated?) TXM bit
IntCLK .set NO ;(internal clks generated?) MCM bit
BurstMode .set YES ;(if BurstMode=NO, then Continuous) FSM bit
CLKDIV .set 3 ;(3=default value, 1/4 CLOCKOUT)
PCM_Mode .set NO ;(Turn on PCM mode?)
FS_polarity .set NO ;(change polarity)YES=^^^\_/^^^, NO=___/^\___
CLK_polarity .set YES ;(change polarity)for BCLKR YES=_/^, NO=~\_
Frame_ignore .set !YES ;(inverted !YES -ignores frame)
XMTautobuf .set NO ;(transmit autobuffering)
RCVautobuf .set YES ;(receive autobuffering)
XMThalt .set NO ;(transmit buff halt if XMT buff is full)
RCVhalt .set NO ;(receive buff halt if RCV buff is full)
XMTbufAddr .set 0x800 ;(address of transmit buffer)
XMTbufSize .set 0x000 ;(length of transmit buffer)
RCVbufAddr .set 0x800 ;(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 ; places buffered serial port in reset
ifr = #10h ; clear interrupt flags
imr = #210h ; Enable HPINT,enable BRINT0
intm = 0 ; all unmasked interrupts are enabled.
bspce = #SPCEval ; programs BSPCE and ABU
axr = #XMTbufAddr ; initializes transmit buffer start address
bkx = #XMTbufSize ; initializes transmit buffer size
arr = #RCVbufAddr ; initializes receive buffer start address
bkr = #RCVbufSize ; initializes receive buffer size
bspc = #(SPCval | GO) ; bring buffered serial port out of reset
return ;for transmit and receive because GO=0xC0
.space 16*32 ;clear a chunk at the end to mark the end
;======================================================================
;
; 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
; ***************************************************************************
21
LTC1402
; The vectors in this table can be configured for processing external and
; internal software interrupts. The DSKplus debugger uses four interrupt
; vectors. These are RESET, TRAP2, INT2, and HPIINT.
; * DO NOT MODIFY THESE FOUR VECTORS IF YOU PLAN TO USE THE DEBUGGER *
;
; All other vector locations are free to use. When programming always be sure
; the HPIINT bit is unmasked (IMR=200h) to allow the communications kernel and
; host PC interact. INT2 should normally be masked (IMR(bit 2) = 0) so that the
; DSP will not interrupt itself during a HINT. HINT is tied to INT2 externally.
;
;
;
.mmregs
reset goto #80h ;00; RESET * DO NOT MODIFY IF USING DEBUGGER *
nop
nop
nmi return_enable ;04; non-maskable external interrupt
nop
nop
nop
trap2 goto #88h ;08; trap2 * DO NOT MODIFY IF USING DEBUGGER *
nop
nop
.space 52*16 ;0C-3F: vectors for software interrupts 18-30
int0 return_enable ;40; external interrupt int0
nop
nop
nop
int1 return_enable ;44; external interrupt int1
nop
nop
nop
int2 return_enable ;48; external interrupt int2
nop
nop
nop
tint return_enable ;4C; internal timer interrupt
nop
nop
nop
brint goto breceive ;50; BSP receive interrupt
nop
nop
nop
bxint goto bsend ;54; BSP transmit interrupt
nop
nop
nop
trint return_enable ;58; TDM receive interrupt
nop
nop
nop
txint return_enable ;5C; TDM transmit interrupt
nop
nop
int3 return_enable ;60; external interrupt int3
nop
nop
nop
hpiint dgoto #0e4h ;64; HPIint * DO NOT MODIFY IF USING DEBUGGER *
nop
nop
.space 24*16 ;68-7F; reserved area
.sect “buffer” ;Set address of BSP buffer for clearing
.space 16*0x800
.sect “result” ;Set address of result for clearing
.space 16*0x800
.end
APPLICATIONS INFORMATION
WUU
U

LTC1402CGN#TRPBF

Mfr. #:
Manufacturer:
Analog Devices Inc.
Description:
Analog to Digital Converters - ADC Serial 12-B, 2.2Msps Smpl ADC w/ SD
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union