Digital Signal Processing Reference
In-Depth Information
ries for . Click twice on the rectangle below the list of Directories , then click
on the “. . .” displayed on the right. Browse in your MATLAB installation
directory for the include path c:\Matlab _ folder\extern\include (for example,
matlabR13 as the Matlab _ folder ). From the Show directories for list, select the
library file item. Click twice on the rectangle below the list of Directories and
select the “. . .” (as before). Browse in your MATLAB folder for the path
c:\Matlab _ folder\extern\lib\win32\microsoft\msvc60 , and click on OK to save
the changes.
Build the Visual C
++
application project. Select Build
Æ
Rebuild All to create
rtdx_vc_FFTMatlab.exe .
9.4 RTDX USING VISUAL BASIC TO PROVIDE INTERFACE BETWEEN
PC AND DSK
Two examples are provided to illustrate the interface between the PC host and the
DSK with RTDX using Visual Basic.
Example 9.9: Visual Basic-DSK Interface Using RTDX for
Amplitude Control of a Sine Wave ( rtdx_vbsine )
This example generates a sine wave outputted through the codec on the DSK. It
illustrates RTDX using Visual Basic (VB) to create a slider and control the ampli-
tude of the generated sine wave.
CCS Component
Figure 9.19 shows the C source program rtdx _ vbsine.c that implements the sine gen-
eration with amplitude control. This is the same C source program used to illustrate
RTDX with Visual C
in Example 9.4 and LabVIEW in Example 9.13. An RTDX
input channel is created and enabled in order to read the slider data from the PC
host. This example is not meant to teach the reader VB, but rather to use it.
Create, save, and add a configuration file rtdx _ vbsine.cdb to the project. Select
INT11, MCSP _ 1 _ Transmit as the interrupt source, and _ c _ int11 as the function (see
Examples 9.1-9.3). Add the autogenerated linker command file and the BSL library
support file. The run-time and the CSL library support files are included in the auto-
generated linker command file. Add also the init and communication file, but not
the vector file. The necessary files are included in the folder rtdx_vbsine .
Build this project as rtdx_vbsine . Within CCS, load and run the executable
file rtdx _ vbsine.out . Verify that a 2-kHz sine wave is generated and outputted
through the codec on the DSK.
Enable RTDX within CCS. Select Tools
++
Æ
RTDX
Æ
Configuration Control
Æ
Enable RTDX (activate/check it).
Search WWH ::




Custom Search