Examples and register assignments
4.3 Registers
SIMATIC PCIe DIO4
Compact Operating Instructions, 11/2011, A5E03493449-01
27
Counter Register
CxCR: Counter x Control Register (BASE + (x*0x100))
Bit
Access Name
Default Description
31..9
RO
0
Reserved
8
RW
CSEL
0
Selection of the Compare register (Compare).
0: Comparison of the Compare Register with the
Counter Register CVR
1: Comparison of the Compare Register with the
Capture Register CAPR
7
RW
CSIEN
0
Enables an interrupt with the comparison result "less
than". If the bit is set to "1" and CxSR.CSIF = 1, CxSR.IF
is set.
6
RW
CGIEN
0
Enables an interrupt with the comparison result "greater
than". If the bit is set to "1" and CxSR.CGIF = 1, CxSR.IF
is set.
5
RW
CEIEN
0
Enables an interrupt with the comparison result "equal
to". If the bit is set to "1" and CxSR.CEIF = 1, CxSR.IF is
set.
4..3
RO
0
Reserved
2
RW
OIEN
0
Enables an interrupt in case of counter overflow. If the bit
is set to "1" and CxSR.OIF = 1, CxSR.IF is set.
1
RW
IEN
0
Enables a counter interrupt. If the bit is set to "1" and
CxSR.IF = 1, a counter interrupt is triggered.
0
RW
EN
0
Enables the counter. If the bit is set to "1", the counter is
in operation. If "0", the counter is stopped and the
counter registers are reset.
CxSR: Counter x Status Register (BASE + (x*0x100))
Bit
Access Name
Default Description
31..11 RO
0
Reserved
10
RO
CS
0
Flag for comparison result "less than". If "1", the selected
compare register CxCR.CSEL is less than the compare
register.
9
RO
CG
0
Flag for comparison result "greater than". If "1", the
selected compare register CxCR.CSEL is greater than
the compare register.
8
RO
CE
0
Flag for comparison result "equal to". If "1", the selected
compare register CxCR.CSEL is equal to the compare
register.
7
RWC
CSIF
0
Interrupt flag for comparison result "less than". If "1", an
interrupt is triggered with the comparison result "less
than": CxVR/CxCAPR < CxCOMR. If the bit is written
with "1", the bit is reset.
6
RWC
CGIF
0
Interrupt flag for comparison result "greater than". If "1",
an interrupt is triggered with the comparison result
"greater than": CxVR/CxCAPR > CxCOMR. If the bit is
written with "1", the bit is reset.