Reply by ching hor December 5, 20002000-12-05
Hi,

I'm trying to implement a simple FIR filter using circular buffers on
c54x dskplus. Below is my code modified from original c54x EVM code.
The main problem of my code is there isn't any data stored in the
fir_coff_table & d_data_buffer after execution. Can someone tell me
what's wrong with my code. Appreciate if someone can correct my code.
Thanks in advance. --------------------- program ------------------------------
.width 86
.length 55
.mmregs

.setsect ".data", 0x400, 1
.setsect ".text", 0x1800, 0
.setsect "vectors", 0x180, 0
.setsect "coff_fir", 0x2700, 0

.sect "vectors"
.copy "firvecs.asm"

COFF_FIR_START .sect "coff_fir"
.word 6Fh
.word 0F3h
.word 269h
.word 50Dh
.word 8A9h
.word 0C99h
.word 0FF8h
.word 11EBh
.word 11EBh
.word 0FF8h
.word 0C99h
.word 8A9h
.word 50Dh
.word 269h
.word 0F3h
.word 6Fh
COFF_FIR_END

FIR_DP .usect "fir_vars", 0
fir_coff_table .usect "fir_coff", 20

.data
d_data_buffer .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

.asg AR0, FIR_INDEX_P
.asg AR4, FIR_DATA_P
.asg AR5, FIR_COFF_P

;---------------- Main program ------------
.text
start:
SSBX INTM
CALLD AC01INIT
STM 1A0h, PMST
STM 0FFAh, SP
LD #0, DP
STM 240h, IMR
RSBX INTM
NOP

;----- initialization ---------
STM #fir_coff_table, FIR_COFF_P
RPT #16-1 ;move FIR coeffs from program to data
MVPD #COFF_FIR_START, *FIR_COFF_P+

STM #1, FIR_INDEX_P
STM #(d_data_buffer+16-1), FIR_DATA_P
STM #fir_coff_table, FIR_COFF_P
WAIT
B WAIT

receive:
LD #FIR_DP, DP
STM #256-1, BRC
RPTBD fir_filter_loop-1
LDM trcv, A
STM #15, BK
STL A, *FIR_DATA_P+%
RPTZ A, 15
MAC *FIR_DATA_P+0%,*FIR_COFF_P+0%,A ;
AND #0FFFCh,A
STLM A, tdxr
fir_filter_loop
RETE

transmit: RETE
;****************************************************
.copy "firinit.asm"
.end