FreeCntr
 
Component FreeCntr
Time measurement based on counter value (suitable for short time periods)
Component Level: Low
This component implements a free running counter that can be used for time measurement (for example measurement of execution time of selected code fragment). The component requires timer with internal clock and periodic interrupt source, such as compare/modulo/reload register or free-running device (interrupt generated on counter overflow). The component doesn't contain SW extension of HW counter. The component additionally supports periodic interrupt generation, that can be handled in the event OnInterrupt. The counter can be optionally reseted within this period, see property Reset counter on compare for details. Interrupt generation can be customized using method SetCompare.

Content of the counter value can be read using method GetCounterValue. If the counter is not shared (i.e. it is used only by this component), methods Reset, Enable and Disable can be used to affect counting. Otherwise (if the counter is shared by several components), these methods are not available.

Version specific information for HCS08 derivatives for peripheral TOD:
Method SetCompare sets only 6 higher bits of the match register (2 LSB bits are ignored), while method GetCounterValue returns whole 8-bit counter. Please refer to datasheets for details.