This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Execution time in tms320c5515 dsp processor

Other Parts Discussed in Thread: TMS320C5515, ADS1115

Hi everyone

I am working with tms320c5515 ezdsp usbstick board.I am trying to interface ads1115 adc with tms320c5515 through i2c interface.I have used the api s given in csl library.My dsp is working at 100 mhz and my sampling rate is 860 sps.I am working with ccsv4.I have used the clock feature of ccs to count to number of clocks required for my i2c routine.I am trying to acquire 500 samples in continuous sampling mode.I am getting number of clocks are 1350463781.So if i divide this with 100 Mhz i get around 14 seconds of execution time.But I have a sampling period of 1/860 seconds.So my code excution should have get completed within 1 second at most to acquire 500 samples.Why this is taking so long.I am really confused about this.i am not even sure i am able to acquire the exact data or i am missing samples.Please help me with this

Thanks

Arun

  • Hi,

    We have taken up your request and it will be addressed as fast as we can.

    Thanks & regards,

    Sivaraj K

  • Hi,

    Few aspects to check with respect to clock feature.

    Can you ensure you followed the details provided in the below wiki link.

    http://processors.wiki.ti.com/index.php/Profile_clock_in_CCS

    Wiki page also mentions certain consideration while measuring the time:  " Some cores have a 1:1 relationship between the clock and the CPU cycles, therefore a simple instruction like NOP located in internal memory should just jump one unit in the counter. However, if the code is located in external memory the CPU will have to wait several cycles until the instruction is fetched to its internal pipeline (caused by waitstates and stalls), this translates to additional clock cycles measured by the Profile clock ".

    For additional information and to confirm on the clock count, suggest you to go through the above wiki link.

    Regards

     Vasanth

  • Hi

    Thanks for your reply.i have gone through this link.From this link only I got the idea of calculating cpu cycles for my code sections.As I have mentioned earlier its seems to me that my cpu is taking too long to read 500 samples of data at 860sps of adc rate.I am not understanding how can this cpu takes so long.And if it takes more than 1 second to read 500 samples of data am I not missing any samples?And I dnt  know what is the ratio of cpu cylcles and clock for this tms320c5515 dsp processor.Please help me with this.

    Thanks

    Arun

  • Hi,

    Good to know that you already have followed the wiki link on clock profiling.

    Can you provide further additional information as mentioned below:

    • Did you try single stepping and observe right count increments.
    • Have you set break points between samplings in your code for measuring the counts or your observed count measurement was by running the entire program.
    • Do you have any wait states in your code ..etc
    • Does your code resides in internal or external memory ?

    The other efficient way to measure is by using the internal general purpose timer. You could start and end the timer approriately to measure the sampling time.

    This clock source determines the speed of the timer since the timer counts down in units of source clock cycles. The source clock for the GP timer can be divided down by a 13-bit prescaler and uses this scaled value as the reference clock of the timer. Each GP timer has its own 13-bit prescaler. When determining the period and prescaler setting for the timer, choose the desired period in units of source clock cycles.

    Regards

     Vasanth

     

  • Have you looked at the i2c code in the library, not just the api?  It has several built-in timeouts and the timeout period is set for a very low I2C clock rate.  Check the I2C clock rate and the timeout period to see if it can be optimized  for your usage or consider rewriting some of the code to remove the timeouts altogether.