Absolute Time
This MotoHawk™ block outputs the current time since reset.
Block ID
motohawk_abs_time
Library
MotoHawk_lib/Extra Development Blocks
Description
If Output Mode is set to
Seconds(double), the output will be a double data type, and the precision will be in
floating point. This means that as time progresses, the exponent will grow and the precision
of the mantissa will shift toward more significant bits.
If Output Mode is set to Seconds(single), the output will be a single data type and the precision will be in
floating point.
If set to Microseconds, the output will be a uint32 data type, and the precision
will always be in microseconds.
If the Width is set to 64 bit the generated code will access the 64 bit counter and will
require 64 bit math operations to complete the conversion from ticks to uSeconds.
If set to 32 bit the generated code will access the 32 counter and thus does not require the 64 bit
math operations for the conversion. When using the 32 counter option it should be noted that the
rollover will occur more frequently.
NOTE: Be aware that, if set to microseconds, after 4294967295 microseconds (the
largest 32-bit value), or a little under 72 minutes, the time value starts over
at zero. Prepare to handle this accordingly.
NOTE:When using the timer width of 32 bit, the rollover of the output is a function of the frequency.
This is due to the conversion from ticks to uSec. The rollover will be 2^32/(ClockFrequency in MHz) for
Power PC based modules. For the S12 running at 50 MHz the rollover is 2^16/5 and for the S12 running at 24MHz
it is 2^16/3.
Block Parameters
Parameter Field | Values | Comments/Description |
---|---|---|
Output Mode | Seconds(double) | Data type is double. |
Seconds(single) | Data type is single. | |
Microseconds(uint32) | Data type is uint32. | |
Width | 64 bit | Access the 64 bit counter requires 64 bit math operations and can casue significant processor loading |
32 bit | Access the 32 bit counter only requires 32 bit math and inturn can reduce processor loading. |