English
Language : 

C515A_9708 Datasheet, PDF (90/182 Pages) Siemens Semiconductor Group – 8-Bit CMOS Microcontroller
On-Chip Peripheral Components
C515A
6.2.2.5 Capture Function
Each of the compare/capture registers CC1 to CC3 and the CRC register can be used to latch the
current 16-bit value of the timer 2 registers TL2 and TH2. Two different modes are provided for this
function. In mode 0, an external event latches the timer 2 contents to a dedicated capture register.
In mode 1, a capture will occur upon writing to the low order byte of the dedicated 16-bit capture
register. This mode is provided to allow the software to read the timer 2 contents “on-the-fly“.
In mode 0, the external event causing a capture is :
– for CC registers 1 to 3: a positive transition at pins CC1 to CC3 of port 1
– for the CRC register: a positive or negative transition at the corresponding pin, depending
on the status of the bit I3FR in SFR T2CON. lf the edge flag is
cleared, a capture occurs in response to a negative transition; lf the
edge flag is set a capture occurs in response to a positive transition
at pin P1.0 / INT3 / CC0.
In both cases the appropriate port 1 pin is used as input and the port latch must be programmed to
contain a one (1). The external input is sampled in every machine cycle. When the sampled input
shows a low (high) level in one cycle and a high (low) in the next cycle, a transition is recognized.
The timer 2 contents is latched to the appropriate capture register in the cycle following the one in
which the transition was identified.
In mode 0 a transition at the external capture inputs of registers CC1 to CC3 will also set the
corresponding external interrupt request flags IEX3 to IEX6. lf the interrupts are enabled, an
external capture signal will cause the CPU to vector to the appropriate interrupt service routine.
In mode 1 a capture occurs in response to a write instruction to the low order byte of a capture
register. The write-to-register signal (e.g. write-to-CRCL) is used to initiate a capture. The value
written to the dedicated capture register is irrelevant for this function. The timer 2 contents will be
latched into the appropriate capture register in the cycle following the write instruction. In this mode
no interrupt request will be generated.
Figure 6-21 illustrates the operation of the CRC register, while figure 6-22 shows the operation of
the compare/capture registers 1 to 3.
The two capture modes can be established individually for each capture register by bits in SFR
CCEN (compare/capture enable register). That means, in contrast to the compare modes, it is
possible to simultaneously select mode 0 for one capture register and mode 1 for another register.
Semiconductor Group
6-39
1997-08-01