FLProg

Visual programming for not programmers

Яндекс.Метрика
High-speed counter


The block serves to count pulses on attached to him digital input controller for a predetermined period of time, calculation of duration impulso and the gaps between them, counting the total number mulsow and organization of the delay line with the input pulse to the output. the unit is made with the use of a hardware interrupt, regardless of the performance of the rest of the program controller. Related to the restriction on the use of the digital inputs. Arduino have only a few inputs may be used to call interrupts.

The list of inputs with a hardware interrupt, depending on the type of Arduino.
Uno and similar 2 3
Mega2560 2 3 21 20 19 18
Leonardo 3 2 0 1 7

General settings block


In General settings select pin of the controller on which the measurements will be made, if necessary is added to the output of "IV" which will be duplicated pulse received on the selected controller input.


Function pulse counting over a period of time


There are two ways of counting time, a software timer, and hardware timer.
A hardware timer provides higher accuracy, but imposes certain restrictions. Firstly the use of a hardware timer eliminates the possibility of using 3 and 11 digital outputs in PWM mode. Secondly, all high-speed counters in the project use a hardware timer have the same time account. In the case of a software timer different counters can have different computation. When using a hardware timer, you cannot use the functions of the delay line. Results are issued on the release of the "CiT"

Experimentally obtained the following characteristics of the counter.
The maximum pulse repetition frequency of 130 kHz.
The minimum pulse duration is 50 nc.





Setting the function of counting total number of pulses


When using this function the output is "CP" unit is issued the total number of pulses received on the input. When you add inputs of the counting pulses will be produced only in the presence of high-level whodc "EnCI".
When you add a reset account on the leading edge impulse input "RCI" the results of the accounts will be reset to 0.
Counting of pulses will be produced depending on the settings for front or rear front



Configuring the calculation function of the pulse duration and pause


When using this function, output "PDP" (when installing check-box "output pulse duration will be the duration of the last incoming pulse, and the output is "PDN" (when installing check-box "output of the pause duration will be the duration of the last pause between pulses.
When adding the enable input of measurement, measurement of bude is only possible in the presence of high level input "EnPD". At a low level on this input outputs will be the last allowed value of measurement.


Setting up delay lines


When using this function in controller output or at the output of the block "DLO" (depending on settings) with a given delay of the transmitted pulse comes to the bound input unit. The delay may be a constant or input DT of the unit. When you select the transmission delay on the rising edge the output will be transmitted to the front impulse with a predetermined time delay of the pulse width is set by parameter "pulse Duration". When you select reverse the front output with a given delay is transmitted falling edge of the input pulse pause duration specified in the parameter "Duration of pauses". When selecting both modes, the input pulse is transferred to the output unchanged with a specified delay.
When adding the enable input of the line delay input pulse will be transferred to the output only in the presence of high level input "EnDL"