Chapter 7 High-speed Counter Module AH02HC/AH04HC
7-19
2. Bit 1 in CR0/CR28/CR56/CR84: If bit 1 in CR0/CR28/CR56/CR84 is turned ON, the sampling
register/accumulation register/pulse input register, and bit 1 in CR19/CR47/CR75/CR103 will be
reset. After the sampling register/accumulation register/pulse input register, and bit 1 in
CR19/CR47/CR75/CR103 is reset, bit 1 in CR0/CR28/CR56/CR84 will be turned OFF
automatically.
a. If bit 1 in CR0/CR28/CR56/CR84 is turned ON, the sampling register/accumulation
register/pulse input register will be reset to 0 immediately.
b. If the linear accumulation is larger than the maximum value 999999999 or less than the
minimum value -999999999, the accumulation register will stop counting, the value in the
accumulation register will be 999999999 or -999999999, and bit 1 in
CR19/CR47/CR75/CR103 will be turned ON. If bit 1 in CR0/CR28/CR56/CR84 is turned
ON, the accumulation counter will be reset, bit 1 in CR19/CR47/CR75/CR103 will be
turned OFF, and the linear accumulation can be executed.
3. Bit 2 in CR0/CR28/CR56/CR84: If bit 2 is turned ON, bit 2 in CR19/CR47/CR75/CR103 will be
reset. After the circular accumulation is reset, bit 2 in CR0/CR28/CR56/CR84 will be turned OFF
automatically.
If the circular accumulation is larger than the maximum value 999999999 or less than the
minimum value -999999999, bit 2 in CR19/CR47/CR75/CR103 will be turned ON. If bit 2 in
CR0/CR28/CR56/CR84 is turned ON, the value in the accumulation register will be cleared,
and bit 2 in CR19/CR47/CR75/CR103 will be turned OFF.
4. Bit 3 in CR0/CR28/CR56/CR84: If bit 3 in CR0/CR28/CR56/CR84 is turned ON, bit 3 in
CR19/CR47/CR75/CR103 will be reset. After bit 3 in CR19/CR47/CR75/CR103 is reset, bit 3 in
CR0/CR28/CR56/CR84 will be turned OFF automatically.
If the value in the accumulation register meets the comparison condition set, bit 3 in
CR19/CR47/CR75/CR103 will be turned ON. If bit 3 in CR0/CR28/CR56/CR84 is turned ON,
bit 3 in CR19/CR47/CR75/CR103 will be turned OFF.
5. Bit 6 in CR0/CR28/CR56/CR84: If bit 6 in CR0/CR28/CR56/CR84 is turned ON, the error flag
will be cleared. After the error flag is cleared, bit 6 in CR0/CR28/CR56/CR84 will be turned OFF.
If bit 0 in CR0/CR28/CR56/CR84 is turned from OFF to ON, and related parameters are set
incorrectly, the system will automatically judge that there is an error, and bit 6 in
CR19/CR47/CR75/CR103 will be turned ON immediately. Users can read the error code in
CR26/CR54/CR82/CR110. If bit 6 in CR0/CR28/CR56/CR84 is turned ON, bit 6 in
CR19/CR47/CR75/CR103 will be turned OFF.
7.9.2 Input Pulse Type
CH0 CH1 CH2 CH3
High word Low word High word Low word High word Low word High word Low word
- #1 - #29 - #57 - #85
Bit 1 Bit 0 Description
0 0 Double pulse (counting up/counting down)
0 1 Single pulse (pulse/direction)
1 0 One time the frequency of A/B-phase inputs
1 1 Four times the frequency of A/B-phase inputs
7.9.3 Frequency of an Input Pulse
CH0 CH1 CH2 CH3
High word Low word High word Low word High word Low word High word Low word
- #2 - #2 - #2 - #2
[Description]
The function is used to set the frequency of an input pulse which needs to filtered.
1. Filter coefficient
4N
2
85000
(kHz); N=0~19