How to measure time on uCOS-2, MOD5270 board

Discussion to talk about software related topics only.
Post Reply
Alexander
Posts: 7
Joined: Tue Dec 23, 2014 11:33 pm

How to measure time on uCOS-2, MOD5270 board

Post by Alexander »

How can I measure the time simple and effective between 2 events in the task(data receiving by MailBox semaphore) using PIT module(may be by reading register and without interrupt). I work on uCos 2, MOD5270.

Thanks in advance
Alexander
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: How to measure time on uCOS-2, MOD5270 board

Post by dciliske »

You can use the HiResTimer utility. It uses the 32-bit DMA timers to perform stop watch functions.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Alexander
Posts: 7
Joined: Tue Dec 23, 2014 11:33 pm

Re: How to measure time on uCOS-2, MOD5270 board

Post by Alexander »

Thanks, I tried, it works perfectly
Earlier, I already implemented such measuring by PIT timers re-scaling, but these timers should be occupied by another services in the project. So, DMA Timers APIs is the solution !
Alexander
Posts: 7
Joined: Tue Dec 23, 2014 11:33 pm

Re: How to measure time on uCOS-2, MOD5270 board

Post by Alexander »

Hello, Dan

DMA Timers APIs work properly except one thing.
When I try to stop timer(exactly as in the example) using 2 functions

timer->stopClear();
timer->clearInterruptFunction();

the system crashes. Do you have any idea about it ?

Thanks in advance
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: How to measure time on uCOS-2, MOD5270 board

Post by dciliske »

If your only using the timer for timing, you don't need to 'clearInterruptFunction's. I'm not entirely certain what would happen if you used that call without first setting one, but even then it shouldn't be causing you to crash. Are you sure that you have a valid timer handle? (aka, the pointer isn't NULL)

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply