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.

CCS/LAUNCHXL-F28379D: How to measure time difference between two events in a program?

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

How to configure my F28379D launchpad to show 24 hours frame with milli seconds resolution. How to caluclate time difference between two time instants (which is triggered ocassionaly in the program based on the events ) with milli seconds resolution. please elaborate possible ways and I appriciate provide proper material with source programs.

  • Hi Sir,

    We are working to find the appropriate expert to help you. You could expect feedback after the weekend. Thanks.
  • You can achieve this resolution with any of the CPU timers.  Assuming you are running the device at its' maximum speed of 200 MHz, you can divide down the timer clock by the maximum pre-scaler of 2^16 so the frequency is about 3 kHz (~0.327 ms resolution).  At this frequency, in one day you will count 263e6 counts into the 32-bit counter, so you are well within the 200e30 capacity of the counter.

    You would configure and start the timer, then read the counter from your code on an event.  Probably you would do this in an ISR. There will be a small error from the interrupt jitter and a few cycles to read the counter, but these will be common to all events.

    There is no example code which does exactly this, but it is straightforward and you can use the CPU timer code example in C2000Ware as a starting point.

    I hope this helps.

    Regards,

    Richard 

  • Code Composer Studio has a clock feature - requires breakpoints, but is pretty straight-forward. In Debug mode, go to Run-->Clock to set up the clock.

    Also, if you have a spare I/O available, you can do timing by adding code to take the I/O high, and at later time, take I/O low.

    Hopefully, that is additional help.
  • We haven't heard back from you for a few days so are wondering if you are still in difficulty with this?

    Regards,

    Richard