Digital Signal Processing Reference
In-Depth Information
The MCBSP1 transmit interrupt is used and INT11 is selected in the examples
throughout the topic. If the program is polling-based, the McBSP is continuously
tested before reading (for input) or writing (for output).
Within the function output_sample() used for output, in the code segment
If (poll) while(!MCBSP_xrdy(...)); MCBSP_write(...);
the first line of code continuously tests (if polling-based) the transmit ready xrdy
register bit. If it is a 1, then the subsequent line of code is executed to write (output).
If the transmit ready bit is a 0 (not ready), then the while() statement becomes
while (true) and execution remains in an infinite loop until the transmit ready bit
becomes a 1 (ready). If the program is not polling-based, then the transmit ready
bit is not tested and writing (output) occurs every sample period.
Similarly, within the function input_sample() used for input, in the code
segment
If (poll) while(!MCBSP_rrdy(...)); MCBSP_read(...);
the first line of code continuously tests (if polling-based) the receive ready rrdy reg-
ister bit. If it is a 1 (ready), the subsequent line of code reads the data. If it is a 0
(not ready), the while ( ) statement causes execution to remain in an infinite loop
until the receive ready bit register becomes a 1. If the program is not polling-based,
the receive ready bit is not tested and reading occurs every sample period.
The examples throughout the topic use both interrupt-driven and polling-based
programs. A polling-based program can be readily changed to interrupt-driven and
vice versa. Interrupts are discussed further in Chapter 3.
Header File ( c6713dskinit.h )
The corresponding header support file c6713dskinit.h contains the function
prototypes as well as various register settings associated with the AIC23 codec. For
example (see c6713dskinit.h ):
1. The mic input can be set in lieu of the line input by changing the value of reg-
ister 4 from the (default) value of 0x0011 to 0x0015.
2. In Chapter 2, a loop program yields an output that is the delayed input, with
the same frequency but attenuated (by default). To increase the gain of the
(default) left line input channel, change the value of register 0 from 0x0017 to
0x001c. This value will produce an output of the same amplitude as the input.
Note that either the line input or the mic input can be made active.
1.7.2 Vector File (vectors_intr.asm/vectors_poll.asm)
To select interrupt INT11, a branch instruction to the ISR c_int11 located in the
C program (see sine8_buf.c ) is placed at the address INT11 in vectors_
intr.asm . A listing of the file vectors_intr.asm is shown in Figure 1.15. Note
Search WWH ::




Custom Search