Digital Signal Processing Reference
In-Depth Information
polling technique uses a continuous procedure of testing when the data are ready.
Although it is simpler than the interrupt technique, it is less efficient since the input
and output data need to be continuously tested to determine when they are ready
to be received or transmitted.
1. The input to the ADC is from the data receive register (DRR) of the McBSP1.
Since this is a polling-driven program, the SPCR bit 1, which is the receive
ready register (RRDY), is first tested to determine if it is a 1 or enabled (see
Figure B.8). Within input_sample , execution of the statement
While (!MCBSP_rrdy())
remains in an infinite loop until RRDY becomes 1 or enabled. Execution then
proceeds to read/receive the data.
2. Within the function output_sample , the MCBSP1 writes the output from
the DAC to the data transmit register (DXR) of McBSP1. Since this is a
polling-driven program, the transmit ready register (XRDY) bit 17 of SPCR
(see Figure B.8) is first tested to see if it is a 1 or enabled. Within
output_sample , execution of the statement
While (!MCBSP_xrdy())
remains in an infinite loop until the transmit ready register becomes 1 or
enabled. Execution then proceeds to transmit/write the data.
The same support files as in Example 1.1 are used: the “black box” communica-
tion/init file c6713dskinit.c , the vector file vectors_poll.asm , the linker
command file c6713dsk.cmd (all three from the folder support ), and the three
library-support files.
Create and build this project as loop_poll . Use the same input as in Example
2.1 and verify the same results.
Example 2.3: Stereo Input and Stereo Output
( loop_stereo/sine_stereo )
Loop Program with Stereo Input and Stereo Output ( loop_stereo )
This example demonstrates input and output using the stereo capability of the
onboard AIC23 codec. It requires the use of an adapter with two inputs and one
output that connects to the DSK. Such an adapter has one input connector white
(or silver) that represents the left channel and another input connector red (or gold)
that represents the right channel. This adapter becomes essential for some of the
examples on adaptive filtering that require two separate input signals, processing
each input separately. Figure 2.6 shows the loop program loop _ stereo to illustrate.
Search WWH ::




Custom Search