Sine-Wave Generator and Loopback Program
3-7
Setting Up the AD50-EVM
return
; return from subroutine
waitfortdx
; a robust way of waiting for a tdm port
b = mmr(ifr)
; transmission to complete
b &= #10000000b
nop
nop
if(BEQ) goto waitfortdx
return
;--------------------------------------------------------------------------------
receive
; save context if necessary
B = mmr(TRCV)
; always read serial port to avoid buffer overflow
; which would stop interrupts from being generated
.if makesine = 0 ; don’t make a sinewave - just echo data from adc to dac
; put code for filtering etc here
.else
; make a sinewave on LEFT channel
AR1 = #sineindex
AR2 = #sinevalue
A = *AR1
A += #sinestepsize
B = A
A -= #sinetablesize
nop
; two nops to allow for pipeline delay
nop
if (ALT) execute(1) ; check whether index points outside table
A = B
*AR1 = A
A += #sinetable20_3dB
*AR2 = prog(A)
; get sinewave value from table in program memory
B = *AR2
; (could use sine table in rom for this)
.endif
.if mode16bit = 0
B &= #1111111111111110b ; mask least significant bit if in 15 bit mode to
.endif
; prevent inadvertent secondary communication requests
mmr(TDXR) = B
; restore context if necessary
return_enable
; return to waiting loop
;--------------------------------------------------------------------------------
transmit:
; Transmit and receive interrupts are inherently
; synchronized so there is no point in using both
return_enable
;--------------------------------------------------------------------------------
sinetable20_3dB ; -3dB re clipping, 1kHz @ 20 ksps, 20 samples/cycle
.word 0, 7160,
13619, 18745, 22036, 23170, 22036, 18745, 13619, 7160
.word 0, -7160, -13619, -18745, -22036, -23170, -22036, -18745, -13619, -7160
sinetable8_3dB ; -3dB re clipping, 1kHz @ 8 ksps , 8 samples/cycle
.word 0, 16384, 23170, 16384, 0, -16384, -23170, -16384
.end
Summary of Contents for SLAU039
Page 6: ...vi ...
Page 16: ...1 6 ...
Page 26: ...2 10 ...
Page 34: ...3 8 ...
Page 40: ...4 6 ...
Page 47: ...Circuit Diagrams A 7 Installing the AD50 EVM A 4 Circuit Diagrams ...
Page 48: ...A 8 ...
Page 49: ...A 9 Installing the AD50 EVM ...
Page 50: ...A 10 ...
Page 51: ...PCB Diagrams A 11 Installing the AD50 EVM A 5 PCB Diagrams Top Side Silkscreen ...
Page 52: ...A 12 1 Top Side Tracks Top Side Tracks ...
Page 53: ...A 13 Installing the AD50 EVM Bottom Side Tracks ...
Page 54: ...A 14 Ground plane ...
Page 55: ...A 15 Installing the AD50 EVM Power plane ...
Page 56: ...A 16 ...