Functional description and allocation of terminal pins Manual BG41/BG42/BG43
3-42 Rev. 99/49
Mode 6 Measurement of pulse width
In this mode the impulse, whose width is to be measured, is to be
positioned at input UA1. A counter frequency of 10 Mhz is used.
The count direction can be determined by the UA2.
UA2 = 1 → counts downwards
UA2 = 0 → counts upwards
The counting process is started with the falling edge of the UA1 and is
terminated with the rising edge. The corresponding count is recorded in a
register and can be read from there.
Mode 7 Measurement of frequency
With this mode an unknown frequency can be measured. The unknown
frequency is to be positioned at input UA1 and a known frequency e.g.
created by the clock generator, at UA2.
If UA2 goes from 1 to 0, the counting process starts with the frequency of
UA1. If UA2 goes from 0 to 1, the counter process is stopped, the count is
loaded into the output register and the counter is reset.
Example
The following example shows how a counter module is to be parametrized. You will find here
among others the parametrizing of the functional blocks for reading and the ? of counters.
Startup-OBs
#OB20
00002 :SPA FB 100
NAME #PROCW
ADR =KH F080 Base address
KANR =KF +1 Channel number
PROC =KF +5 Procedure counter
FEHL =MB 199 Error byte
0000E :
00010 :SPA FB 12
NAME #MODE
ADR =KH F080 Base address
KNR =KF +1 Channel number
MOD1 =KF +1 Counter 1 in mode 1
MOD2 =KF +3 Counter 2 in mode 3
MOD3 =KF +0 Counter 3 in mode 0
0001E :
00020 :BE