Capture
 
Component Capture
Timer capture encapsulation
Component Level: Low

This component implements the capture function of timer.

The counter counts in free run mode (from internal CPU clock and overflows at maximum timer range). On the selected edge of the input signal (on the input pin), the current content of the counter register is written into the capture register and the OnCapture event is called. Counter overflow (i.e. when counter register's value goes over the "Maximal time" property value) is signalized by calling the OnOverflow event (if supported). Overflow can be detected only if interrupt/events are enabled. In polling mode the component has no information about overflow.

The component can be used for example to measure period of the input signal or time between Reset of the counter and select event on the input pin.

Note: If the timer is shared with other component(s) or the timer counter does not support hardware reset settings the component can generate methods Reset, GetCaptureValue code with its functionality provided in software only.

Version specific information for PWT timer on HCS08 derivatives
Both PWT registers (positive and negative pulse width registers) are supported by this component - via device PWTXcapture. Method GetCaptureValue returns first captured value, method GetCaptureValue2 returns second captured value.