AnsweredAssumed Answered

help for BTC function

Question asked by ben2011 on Oct 8, 2011
Latest reply on Oct 28, 2011 by CraigG

hi everybody

 

    I am using bf512f  to do a project  I want to use BTC function to view some data to help me debug the code.

 

   I have add the btc code to my project ,and I can read the data from the processor .  but the data it read is not what I wanted.

 

   so I have some questions?

 

 

  1:  in the vdsp5.0++ help   I find that I should add the btc lib file           if the processor is  Blackfin    we should add libbtc53x.dlb, from the lib folder I find two libbtc532.dlb and libbtc535.dlb ,which differences are the two files ? now I use libbtc532.dlb, and now I can read the data from the processor. but I do not know why we should use libbtc53x.dlb because I use the bf512 processor?

 

2:  in the vdsp5.0++ help  I find that there are two BTC mode

 

BTC Mode 1 - Transfer an array of data:

[Blackfin] This method uses the btc_write_array() function. Data is captured at a specific point in the DSP application, copied to  a transfer buffer, and held until the host reads the data.

 

btc_write_array(Channel number, Start Address, Length);

 

 

BTC Mode 2 - Sample a test point over time:

[Blackfin] This method uses a data buffer in the DSP program and  the btc_write_value() function. The sampled  input data value is copied to the data transfer buffer and is read according to  the plot refresh rate.

 

btc_write_value(Channel number, Start Address, Length);

 

 

now I want to read data from a interrupt .  so I think I should use the mode2, so what I did is :

 

 

#include "btc.h"

 

INT16 test1=0;            

INT16 BTCCHAN0[6000]={0};            //buffer

 

 

BTC_MAP_BEGIN

//             Channel Name,             Starting Address,    Length

BTC_MAP_ENTRY("buffer1",                 (long)&BTCCHAN0,       sizeof(INT16))

BTC_MAP_END

 

 

 

void main()

...;     

btc_init();

...;

}

 

 

EX_INTERRUPT_HANDLER(pwmsyncinterrupt)
{
     btc_poll();
     ...;
     ...;
     btc_write_value(0,(unsigned int*)&test1, sizeof(test1));
}

Is the structure above right?

 

but I read data is not what I wanted .I do not know why?


Outcomes