information in VisualDSP++ 5.0 documentation is not full, clear and enough for me to use BTC in my own ADSP21369 application.
Please, explain in steps how to set BTC for HPUSB-ICE and C language application.
Procedure taken from Help does not work(linker errors):
Adding BTC to an Existing Project
Adding a BTC to an existing application involves linking to a BTC library, adding BTC channel definitions, defining the BTC channel(s), and initializing, as follows:
- From the Project window, right-click on the Linker Files folder and choose Add File(s) to Folder.
- Browse to the appropriate "lib" folder of your VisualDSP++ installation and select the correct library file.
This links the project against the appropriate BTC library.
- Add the following include statement: BTC channel definitions. To do this, add the following include:
This adds the BTC channel definitions.
- Define the BTC channels themselves. If you are using BTC to monitor an array/arrays, ensure that the arrays have been defined before defining the channels. You should also define an array for each of the channels. The BTC map should have the start and end tags, BTC_MAP_BEGIN and BTC_MAP_END, respectively.
Between these tags, define each of the channels in the form:
BTC_MAP_ENTRY(channel_name, starting_address, channel_length)
// Create an array for each channel, adding locations to accommodate the header,
// where NUMSAMPLES is a defined static value
unsigned int Channel_A[sizeof(NUMSAMPLES + 8)];
unsigned int Channel_B[sizeof(NUMSAMPLES + 8)];
unsigned int Channel_C[sizeof(NUMSAMPLES + 8)];
// BTC Definitions
BTC_MAP_ENTRY("BTC Channel A", (long)&Channel_A, sizeof(Channel_A)) // Channel 0
BTC_MAP_ENTRY("BTC Channel B", (long)&Channel_B, sizeof(Channel_B)) // Channel 1
BTC_MAP_ENTRY("BTC Channel C", (long)&Channel_C, sizeof(Channel_C)) // Channel 2
See Data Logging for more information on the BTC header usage.
- Initialize the BTC channels and start the interrupt. This differs between SHARC and Blackfin processors, as follows:
SHARC: For SHARC processors, the BTC channels are initialized during the application startup code by calling btc_init() .
After initialization, the BTC commands from the host are processed via the low-priority emulator interrupt (EMULI), but first a vector to the interrupt must be installed. This vector is installed using the interrupt() call, as follows:
Blackfin: For Blackfin processors, the BTC channels are initialized during the application startup code by calling btc_init().
- After initialization, the BTC commands from the host are processed via the btc_poll() function. The btc_poll() function can be called from a polling loop, the handler of an interrupt, a thread, and so on.
- Finally, all that is left to do is to write data to the BTC channel so it can be reviewed.
Having performed the step above, the application is now ready to use BTC. To view the BTC channels, choose Debug -> View -> BTC Memory. You can switch between channels from the drop-down menu at top of the BTC Memory window; auto refresh mode allows you to view the data in real-time once configured via the Auto Refresh and Refresh Rate commands available via the mouse's right-click menu.
P.S. Please, give me a simple, but FULL example.