AN2108 Freescale Semiconductor / Motorola, AN2108 Datasheet - Page 12

no-image

AN2108

Manufacturer Part Number
AN2108
Description
AN2108 Programming the DSP56307/DSP56311 EFCOP in C Using Taskings Tool Suite
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Note:
4.1 Polling
main()
{
12
Transferring Data to and from the EFCOP
These transfers are accomplished using either polling, DMA, or interrupts. All the different transfers rely
on two status bits from the FCSR:
The method for transferring data from memory to the FDIR need not be the same as the one for
transferring data from FDOR to memory. Any combination of the methods can be used. For example,
transfers to the FDIR can use a DMA channel while transfers from the FDOR can use interrupts.
With the polling method of data transfer, the core polls a status bit in the EFCOP FCSR to determine when
it can transfer a data sample to or from the EFCOP. The status bit polled depends on whether data is to be
transferred from memory to the FDIR or from the FDOR to memory:
Recall that the filter buffer status bits,
FCSR.B.FDOBF. The following code segment illustrates the use of polling for both writing to the FDIR
and reading from the FDOR. This code is contained in a file named
Filter Data Input Buffer Empty (FDIBE) bit
Filter Data Output Buffer Full (FDOBF) bit
The FDIR register is a 4-word deep FIFO buffer, so one to four words can be written to the FDIR
at a time. In this application note, 4-word transfers are used.
For transfers from memory to FDIR, the FDIBE bit (which is set when the FDIR is empty) is
polled.
For transfers from FDOR to memory, the FDOBF (which is set when the FDOR contains a valid
output data sample) is polled.
/* Initialize data buffers, input[] and output[] */
/* Copy filter coefficients to FDM */
/* Initialize EFCOP -- Select arithmetic modes, operating
FCSR.B.FEN = 1; /* Enable EFCOP */
for (n=0; n<NUMBER_OF_SAMPES; n++)
{
/*** Poll FDIBE until set ***/
while (FCSR.B.FDIBE == 0)
{}
FDIR = input[n]; /* Feed data sample to FDIR */
modes, number of channels, etc. */
Programming the DSP56307/DSP56311 EFCOP in C
Example 1. Use of Polling for Transferring Data
Freescale Semiconductor, Inc.
For More Information On This Product,
/* Wait for FDIBE to become 1 */
FDIBE and FDOBF,
Go to: www.freescale.com
are directly accessed by FCSR.B.FDIBE and
Transfer_by_Polling.c
.

Related parts for AN2108