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.

how to use clock for a dsp 28335 processor in c coding



hi

INn matlab simulink i am using clock for some calculation,instead while coming to dsp cc studio 28335 dsp,how i can replace clock for math operations?

is it the system clock?

how can we use system clock for coding in c language?

for performoing below operation how can i proceed.

for eg: If(clock+T0)>0

{

some operations......

}

  • Joseph,

    The easiest way is to configure a CPU timer to run at the CPU speed and then read its counter from your code. In the header file examples for F28335 you will find the file "DSP2833x_CpuTimers.c" which contains functions to initialize and configure these timers.

    For example, you might choose to set up and start CPU timer 0 in your main file something like this:
    ConfigCpuTimer(&CpuTimer0, 150.0, 10.0e+00);
    StartCpuTimer0();

    You could then read the timer count from your code using:
    t1 = CpuTimer0Regs.TIM.all;

    ...and make a conditional test using t1.

    I hope this helps.

    Regards,

    Richard
  • hi
    thanks alot..i ll go through..