AnsweredAssumed Answered

Help with BTC for ADSP21369

Question asked by RomanR on Aug 13, 2014
Latest reply on Aug 27, 2014 by CraigG

Dear Sirs,


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:

  1. From the Project window, right-click on the Linker Files folder and choose Add File(s) to Folder.
  2. Browse to the appropriate "lib" folder of your VisualDSP++ installation and select the correct library file. 


    BTC Library

    SHARC ADSP-2126x


    SHARC ADSP-2136x






    This links the project against the appropriate BTC library.

  3. Add the following include statement: BTC channel definitions. To do this, add the following include: 

    #include "btc.h"

    This adds the BTC channel definitions.

  4. 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)





    Name of the channel
    (32 characters, maximum)


    Starting address of the channel in memory


    Blackfin: Length of the channel in bytes
    SHARC: Length of the channel in 32-bit words



    For example:

    // 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.

  5. 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:

    interrupt(SIG_EMUL, btc_isr);

    Blackfin: For Blackfin processors, the BTC channels are initialized during the application startup code by calling btc_init().

  6. 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. 


  7. 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.



Kind regards




P.S. Please, give me a simple, but FULL example.