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

get current time in microseconds method

I'm using the Timer 3 and I want to verify that the ISR is being called at the correct interval. I wanted to use a the clock() function but I can't include <time.h>. What should I do??? Thanks

Parents
  • Not discussing the port method, that is surely the best one.
    About clock() function I'm working with MCB2300 and don"t have search feature implemented (neither with RTX included). Well what it would be using as a base time ? (RTC does not provide a us accuracy, in my case 1s/2^15)

    If you use a other hardware timer, you may read TC after N interrupts, calculate mean TC/N and convert it to time. Be aware of you timer resolution, and when its resetting.

    But in fact measuring T1 accuracy with T2 that would have the same accuracy has something tricky.

Reply
  • Not discussing the port method, that is surely the best one.
    About clock() function I'm working with MCB2300 and don"t have search feature implemented (neither with RTX included). Well what it would be using as a base time ? (RTC does not provide a us accuracy, in my case 1s/2^15)

    If you use a other hardware timer, you may read TC after N interrupts, calculate mean TC/N and convert it to time. Be aware of you timer resolution, and when its resetting.

    But in fact measuring T1 accuracy with T2 that would have the same accuracy has something tricky.

Children