English
Language : 

C508_01 Datasheet, PDF (124/267 Pages) Infineon Technologies AG – 8-Bit CMOS Microcontroller
C508
On-Chip Peripheral Components
6.3.2.7 Trap Function of the CAPCOM Unit in Compare Mode
When a channel of the CAPCOM unit operates in compare mode, its output lines can be
decoupled in trap mode from the CAPCOM pulse generation. The trap mode is
controlled by the external signal CTRAP. The CTRAP signal is sampled at each phase
of the oscillator clock cycle. If a low is detected, the trap flag TRF of register TRCON is
set and CCx or COUTx compare outputs are switched immediately to the logic state as
defined by the bits in COTRAP if that particular channel has been enabled for trap
function. The compare outputs of the channels which are not enabled for trap function
will have their last output levels maintained. For safety reasons, it is recommended that
trap function be enabled. If CT1RES = 0, Compare Timer 1 continues its operation but
no compare output signal will be generated. If CT1RES = 1, Compare Timer 1 is reset
when CTRAP becomes active. When CTRAP is sampled inactive (high) again, the
compare channel outputs are synchronously switched to the compare channel output
signal generation when Compare Timer 1 has reached the count value 0000H.
The trap function is controlled by bits in the TRCON register. The general enable function
of the external CTRAP signal is controlled by one bit (TRPEN). Further, each CAPCOM
compare channel output can be enabled/disabled selectively for trap function.
Figure 6-31 shows the trap function for the two outputs CCx and COUTx of one compare
channel x. The timing diagram implies that the trap function is enabled at the CCx and
COUTx outputs.
At reference point 1) in Figure 6-31 CTRAP becomes active and at reference point 2)
the trap state is released again synchronously to the Compare Timer 1 count state
0000H. If the trap function is enabled and CTRAP becomes active, bit TRF (trap flag) in
SFR TRCON is set and a CCU emergency interrupt will be generated if the related
interrupt enable bits are set. The flag TRF is level sensitive and must be cleared by
software.
The trap function used in block commutation mode differs from the trap function
described above. In particular, the synchronization scheme is different (see
Chapter 6.3.4.6).
User’s Manual
6-59
2001-05