Page 1 of 1
How to measure time on uCOS-2, MOD5270 board
Posted: Tue Dec 23, 2014 11:41 pm
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
Re: How to measure time on uCOS-2, MOD5270 board
Posted: Fri Dec 26, 2014 11:45 am
by dciliske
You can use the HiResTimer utility. It uses the 32-bit DMA timers to perform stop watch functions.
-Dan
Re: How to measure time on uCOS-2, MOD5270 board
Posted: Sun Dec 28, 2014 12:33 am
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 !
Re: How to measure time on uCOS-2, MOD5270 board
Posted: Wed Dec 31, 2014 11:48 pm
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
Re: How to measure time on uCOS-2, MOD5270 board
Posted: Mon Jan 05, 2015 9:29 am
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