Timer Input Get

From OpenMBD
< HANcoder‎ | STM32‎ | Blocks
Jump to: navigation, search
Supported Targets: Olimexino, E407, P405

General information about Timer Input Get

Reads the information from a timer input pin.





Inputs (inports)

reset input (optional) if the value goes from 0 to 1 the counter output will be reset.


Output 1:Frequency: The last measured frequency on the pin in Hz.[uint32]
Output 2:Duty cycle: The last measured duty cycle on the pin as a % with a scaling factor of 100 for improved resolution. So 5000 = 50% for example.[uint16]
Output 3:Edge count: The number of edges that were detected on the input pin since startup.[uint32]
Output 4:Edge state: State of the last edge. 1 if it was a rising edge, 0 if it was a falling edge. Note that this output is only useful for low frequency signals where the time between edges is longer than the block's sample time. [uint8]
Output 5:Edge timestamp: A 32-bit timestamp value of the last edge. The timestamp is derived from an internal 32-bit free running counter that runs at 24 Mhz.[uint32]
Output 6:0Hz detected: A boolean flag that will go high if no edges were detected for the time specified as the zero Hz detection time. Upon the next edge the flag will go low again.[boolean]

Block parameters

Parameter Description
Timer input pin Selects the timer input pin. Note that the timer module this pin belongs to is specified as well. When a timer module is used for timer input measurements, it can not be used for other timer related functionality such as quadrature encoder inputs, PWM outputs, etc.
Zero Hz detection time Determines after how many milliseconds since the last edge the 0 Hz detected output flag should go high. Specify a value of zero to not use this feature.
Sample time Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model.

See Also

Quadrature encoder get