page 132,60 ;**************************************************************************** ; FLTR_TST.ASM Ver.2.0 ; Test program for the external memory, analog circuitry, and OnCE ; Port circuitry of the DSP56303EVM evaluation board ; ; Copyright (c) MOTOROLA 1996 ; Semiconductor Products Sector ; Digital Signal Processing Division ; ;**************************************************************************** ; ; nolist include 'ioequ.asm' include 'intequ.asm' include 'ada_equ.asm' include 'vectors.asm' list ;****************************************************************************** ; the following EQUates will define the operatonal parameters ; of the codec. Please refer to the ADA_EQU.ASM source file ; for a description of the parameters selections available. The ; variables defined by the EQUates are sent to the codec via ; the transmit buffer, TX_BUFF. ; ; Since the parameters are defined in ADA_EQU.ASM, these lines must ; follow the include statement. ;****************************************************************************** CTRL_WD_12 equ NO_PREAMP+HI_PASS_FILT+SAMP_RATE_48+STEREO+DATA_16 ;CLB=0 CTRL_WD_34 equ IMMED_3STATE+XTAL1_SELECT+BITS_64+CODEC_MASTER CTRL_WD_56 equ $000000 CTRL_WD_78 equ $000000 TONE_OUTPUT EQU HEADPHONE_EN+LINEOUT_EN+(0*LEFT_ATTN)+(0*RIGHT_ATTN) TONE_INPUT EQU MIC_IN_SELECT+(15*MONITOR_ATTN)+(4*LEFT_GAIN)+(4*RIGHT_GAIN) NOISE_OUTPUT EQU HEADPHONE_EN+LINEOUT_EN+(0*LEFT_ATTN)+(0*RIGHT_ATTN) NOISE_INPUT EQU MIC_IN_SELECT+(15*MONITOR_ATTN)+(15*LEFT_GAIN)+(15*RIGHT_GAIN) ;------------------------------- ;--- constants for oscillators ;-------------------------------- Fs set 48000.0 ;Specify sampling frequency. PI set 2.0*@asn(1.0) ;Compute PI as 2.0*arcsin(1.0) factor set PI/180.0 ;Multiplier for degrees to radians ; Specification for tone a. freq_a set Fs/2.0 ;Specify frequency in Hertz. phi_a set 360.0*(freq_a/Fs) ;Compute phi phase_a set 90.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_a set 0.8 ;Specify amplitude (0-1). theta2_a set (phase_a-(2.0*phi_a)) ;Compute theta2 theta1_a set (phase_a-phi_a) ;Compute theta1 s2_a set amp_a*@sin(factor*theta2_a) ;Compute s2 s1_a set amp_a*@sin(factor*theta1_a) ;Compute s1 coeff_a set @cos(factor*phi_a) ;Compute rcoef in 2:14 format ; Specification for tone b. freq_b set Fs/8.0 ;Specify frequency in Hertz. phi_b set 360.0*(freq_b/Fs) ;Compute phi phase_b set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_b set 0.8 ;Specify amplitude (0-1). theta2_b set (phase_b-(2.0*phi_b)) ;Compute theta2 theta1_b set (phase_b-phi_b) ;Compute theta1 s2_b set amp_b*@sin(factor*theta2_b) ;Compute s2 s1_b set amp_b*@sin(factor*theta1_b) ;Compute s1 coeff_b set @cos(factor*phi_b) ;Compute rcoef in 2:14 format ; Specification for tone c. freq_c set Fs/32.0 ;Specify frequency in Hertz. phi_c set 360.0*(freq_c/Fs) ;Compute phi phase_c set 90.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_c set 0.8 ;Specify amplitude (0-1). theta2_c set (phase_c-(2.0*phi_c)) ;Compute theta2 theta1_c set (phase_c-phi_c) ;Compute theta1 s2_c set amp_c*@sin(factor*theta2_c) ;Compute s2 s1_c set amp_c*@sin(factor*theta1_c) ;Compute s1 coeff_c set @cos(factor*phi_c) ;Compute rcoef in 2:14 format ; Specification for tone d. freq_d set Fs/128.0 ;Specify frequency in Hertz. phi_d set 360.0*(freq_d/Fs) ;Compute phi phase_d set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_d set 0.8 ;Specify amplitude (0-1). theta2_d set (phase_d-(2.0*phi_d)) ;Compute theta2 theta1_d set (phase_d-phi_d) ;Compute theta1 s2_d set amp_d*@sin(factor*theta2_d) ;Compute s2 s1_d set amp_d*@sin(factor*theta1_d) ;Compute s1 coeff_d set @cos(factor*phi_d) ;Compute rcoef in 2:14 format ; Specification for tone e. freq_e set Fs/512.0 ;Specify frequency in Hertz. phi_e set 360.0*(freq_e/Fs) ;Compute phi phase_e set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_e set 0.8 ;Specify amplitude (0-1). theta2_e set (phase_e-(2.0*phi_e)) ;Compute theta2 theta1_e set (phase_e-phi_e) ;Compute theta1 s2_e set amp_e*@sin(factor*theta2_e) ;Compute s2 s1_e set amp_e*@sin(factor*theta1_e) ;Compute s1 coeff_e set @cos(factor*phi_e) ;Compute rcoef in 2:14 format ; Specification for tone f. freq_f set Fs/2048.0 ;Specify frequency in Hertz. phi_f set 360.0*(freq_f/Fs) ;Compute phi phase_f set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_f set 0.8 ;Specify amplitude (0-1). theta2_f set (phase_f-(2.0*phi_f)) ;Compute theta2 theta1_f set (phase_f-phi_f) ;Compute theta1 s2_f set amp_f*@sin(factor*theta2_f) ;Compute s2 s1_f set amp_f*@sin(factor*theta1_f) ;Compute s1 coeff_f set @cos(factor*phi_f) ;Compute rcoef in 2:14 format ; Specification for tone g. freq_g set Fs/4096.0 ;Specify frequency in Hertz. phi_g set 360.0*(freq_g/Fs) ;Compute phi phase_g set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_g set 0.8 ;Specify amplitude (0-1). theta2_g set (phase_g-(2.0*phi_g)) ;Compute theta2 theta1_g set (phase_g-phi_g) ;Compute theta1 s2_g set amp_g*@sin(factor*theta2_g) ;Compute s2 s1_g set amp_g*@sin(factor*theta1_g) ;Compute s1 coeff_g set @cos(factor*phi_g) ;Compute rcoef in 2:14 format ; Specification for tone h. freq_h set Fs/8192.0 ;Specify frequency in Hertz. phi_h set 360.0*(freq_h/Fs) ;Compute phi phase_h set 0.0 ;Specify the phase angle in ; degrees (-180 -- +180). amp_h set 0.8 ;Specify amplitude (0-1). theta2_h set (phase_h-(2.0*phi_h)) ;Compute theta2 theta1_h set (phase_h-phi_h) ;Compute theta1 s2_h set amp_h*@sin(factor*theta2_h) ;Compute s2 s1_h set amp_h*@sin(factor*theta1_h) ;Compute s1 coeff_h set @cos(factor*phi_h) ;Compute rcoef in 2:14 format Fs set 48000 ;------------------------------- ;--- data buffers and storage ;------------------------------- org x:0 RX_BUFF_BASE equ * RX_data_1_2 ds 1 ;data time slot 1/2 for RX ISR RX_data_3_4 ds 1 ;data time slot 3/4 for RX ISR RX_data_5_6 ds 1 ;data time slot 5/6 for RX ISR RX_data_7_8 ds 1 ;data time slot 7/8 for RX ISR TX_BUFF_BASE equ * TX_data_1_2 ds 1 ;data time slot 1/2 for TX ISR TX_data_3_4 ds 1 ;data time slot 3/4 for TX ISR TX_data_5_6 ds 1 ;data time slot 5/6 for TX ISR TX_data_7_8 ds 1 ;data time slot 7/8 for TX ISR RX_PTR ds 1 ; Pointer for rx buffer TX_PTR ds 1 ; Pointer for tx buffer DOSC_BUFF_BASE equ * coeff ds 1 ; data location for osc. a's coeff. s1 ds 1 ; data location for osc. a's sr1. s2 ds 1 ; data location for osc. a's sr2. LOOP_COUNT ds 1 ; data location for the loop counter. LEFT_PEAK ds 1 ; data location for the peak value. RIGHT_PEAK ds 1 ; data location for the peak value. ; location for the ouput of test routine OUTPUT ds 20 ; 2*8 tone peaks + 2*(peak+average)=20 MEM_FAIL_ADDR ds 1 ; OUTPUT+20 MEM_FAIL_EXPECT ds 1 ; OUTPUT+21 MEM_FAIL_RECEIVED_0 ds 1 ; OUTPUT+22 MEM_FAIL_RECEIVED_1 ds 1 ; OUTPUT+23 MEM_PASS_CNT ds 1 ; OUTPUT+24 CHIP_REV ds 1 ; OUTPUT+25 SOFTWARE_REV dc $0000CA ;Revision 2.00 X_START equ * ; used by memory test... BUFF_BASE EQU * ; input data buffer starts here ;--------------------------------------- ;--- code for board test starts here ;--------------------------------------- org p:$100 START movep #$040004,x:M_PCTL ;PLL = 16.9344 x 5 = 84.672MHz movep #$012421,x:M_BCR ; set up one ext. wait state for all AAR areas ori #3,mr ; disable interrupts movec #0,sp move #0,sc movep #$11,x:M_TCSR0 ; turn LED off move #0,omr ; single chip mode movep #$000E07,x:M_IPRC ;enable IRQA & IRQD w/ edge level andi #$FC,mr ;enable interrupts jmp
| z^-1 |--+--->| z^-1 |----+ ; | |_______| | |_______| | ; | | | ; | ___V___ ___V___ ; | | | | | ; | | coeff | | -1 | ; | |_______| |_______| ; | | | ; | | | ; | | | ; | +----->( + )<-----+ ; | | ; | | ; +------------------------+---------> sine output dosc_sin move x:(r0)+,x0 ; Load coeff move x:(r0)+,y0 ; Load s1 into a. move x:(r0)-,b ; Load s2 into b, r0 points to s1. mpy x0,y0,a ;Get coef*s1 in a in 2:14 format subl b,a ;y0,b ;Get (coef*s1 -s2)=sin_val in a ; in fractional format move a,x:(r0)+ ; Save new s1. move y0,x:(r0) ; Save new s2. rts include 'ada_init.asm' include 'echo.asm' include 'u_memtst.asm'