Motorola MSC8101 ADS User's Guide Page 191

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 190
Programming Examples
Enhanced Filter Coprocessor (EFCOP) 9-15
resolution and that memory is addressed in one byte resolution. Therefore, the
FDM and FCM are located at 0x400 multiplied by four plus the base address,
which is memory location 0x71000 for the FDM and 0x79000 for the FCM.
b. The
FCNT constant defines the filter length and is equal to twice the number of
complex filter coefficients (that is, if there are five complex filter coefficients,
FCNT should be 10). FCNT –1 is written to the filter count register.
c. The value 0x0011 is written to FCTL to enable the EFCOP in complex FIR
filter mode with data initialization enabled.
3. Before the first filter operation, the FDM buffer must be initialized because the
FPRC bit is clear. To initialize the FDM buffer for complex data,
FCNT/2 complex
samples must be written to the FDM through the FDIR. The code uses a short loop
to write the first
FCNT/2 complex samples of the input data to the FDIR using
move.2l instructions.
4. The code waits until an output is available in the FDOR register by polling the
FSTR[9]:FOBNE bit. The code tests the FSTR[9]:FOBNE bit and jumps back to
the test if the bit is not set. When this bit is set, the output of the filter operation is
ready and the code continues.
5. The FDOR is read using a move.2l instruction, and the complex value is placed
into the output data buffer.
6. The next complex input data sample is written to the FDIR, and the process
continues until all the input data values are written to the FDIR.
7. The last output value is read, and the filter is complete.
Example 9-1. Complex FIR Filter Code
move.w #INPUT,r0 move.w #OUTPUT,r1 ;Init data pointers
move.l #M_FDIR,r2
move.l #M_FDOR,r3
move.w #$400,d0 ;Init FDBA
move.w d0,M_FDBA
move.w #$400,d0 ;Init FCBA
move.w d0,M_FCBA
move.w #FCNT-1,d0 ;Init FCNT
move.w d0,M_FCNT
move.w #$0011,d0 ;Init FCTL
move.w d0,M_FCTL
doensh0 #FCNT/2 ;Init data taps
move.2l (r0)+,d0:d1
loopstart0
move.2l d0:d1,(r2)
move.2l (r0)+,d0:d1
loopend0
Page view 190
1 2 ... 186 187 188 189 190 191 192 193 194 195 196 ... 345 346

Comments to this Manuals

No comments