Page 1 of 1

TimeAbsType GetTime(void)

Posted: Tue Apr 05, 2011 10:11 pm
by nest
Hello,

does anyone know the size of the data type TimeAbsType? It's 8, 16 or 32 bits?

How can I measure time with GetTime() function? I understand that whit this function the TimeAbsType's returned value is increased a bit with every processor cycle. When the register's bits are full it returns to start from scratch again. I'm right?


Thank you!
Néstor

Re: TimeAbsType GetTime(void)

Posted: Wed Apr 06, 2011 8:37 am
by paolo.gai
The idea is the following:

- we are using an efficient implementation of the EDF scheduling algorithm, which supports timers with wraparound

- giving a fixed size for the time value will end up being inefficient on some machines

- That is, the TimeAbsType is mapped on EE_TYPEABSDLINE which is mapped on the typical size of a timer on the specific architecture.

- If I'm not wrong, we are using a 32 bit free-running timer on dsPIC (2 16-bit timers connected together) (that is explained in the PIC30 arch manual)
Currently http://erika.tuxfamily.org/download/man ... _1_1_9.pdf

- all other architectures typically have a timer register which is the same size of the registers (32 bit on 32 bit MCUs, 16 bit on 16 bit MCUs

I hope it helps...

PJ