This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Time measurement in DScope

Does anybody know how I can measure the time between two breakpoints. I am using dscope monitor.

Leo

  • You can use the Performance Analyser to monitor it. Add all the functions between the breakpoints in the PA. Durring the first breakpoint go to the PA and reset the values ( clear all of them ), After the Second breakpoint the program execution will stop again, so you can return in the PA and watch the elapsed time...

    Just remember to set the proper clock frequency in the project information.

  • Hi Alex,
    I'm working in target mode! In target mode it is impossible to use the PA of dscope (command not supported in target mode).

    Bye
    ...Leo

  • In target mode, if you have any available post pins, simply output a high when you hit onr point in the code, and a low when you hit the next point. You can then use a scope to monitor the line and get an exact measurement. This can be done with as many port pins as you have available. Just remember to remove them, or make them a conditional assembly or compile to prevent shipping the target that way

  • I need to agree with you... ;-)

    - Alex

  • It would be nice if MON166 was able to link in a user function to run when it hits a breakpoint. Time measurement would be one thing you could do, but an even more valuable function would be to put the target hardware in a safe condition.

    I build systems with PWM controlled motors, it is always a challenge to safety these things during development.

  • It would be nice if MON166 was able to link in a user function to run when it hits a breakpoint.

    Ahhhh, but it can.

    Set a breakpoint that executes a debugger printf that reads and outputs the contents of one of the timer SFRs.

    Use the Breakpoints dialog to do this (it's easier). For the command, enter:

    printf("I Got Here\n")

    to test and see what happens when the breakpoint occurs. Then, go from there.

    Jon



  • jon,

    Thank you for the response, I really meant that I would like the monitor to call my function on any breakpoint. What you suggest would work fine for timing measurments. Be aware that usint the printf in a real time system is a real problem sinc the monitor uses a polled I/O mode that blocks all other tasks.

    Eric