Download User`s Manual 06.96 8-Bit CMOS Microcontroller http://www.siemens
Transcript
On-Chip Peripheral Components C504 Trap Enable Register The trap enable register TREN is used to enable selectively the compare outputs of the three CAPCOM channels for switching it into high or low level in the trap state as defined by the bits of the COINI register. Additionally, for a general enable of the trap function, bit TRPEN must be set. The TRF flag indicates when an low level is detected at the CTRAP input signal. Special Function Register TRCON (Address CFH) Bit No. MSB 7 CFH TRPEN 6 TRF 5 4 3 Reset Value : 00H 2 1 LSB 0 TREN5 TREN4 TREN3 TREN2 TREN1 TREN0 TRCON CAPCOM Channel 2 CAPCOM Channel 1 CAPCOM Channel 0 Bit Function TRPEN External CTRAP trap function enable bit This bit is a general enable bit for the trap function of the CTRAP input signal. TRPEN = 0 : External trap input CTRAP is disabled (default after reset). TRPEN = 1 : External trap input CTRAP is enabled; TRF Trap flag TRF is set by hardware if the trap function is enabled (TRPEN=1) and the CTRAP level becomes active (low). If enabled, an interrupt is generated when TRF is set. TRF must be reset by software. TREN5-TREN0 Trap enable control bits Bits at even bit positions (0,2,4) are assigned to the CCx compare outputs. Bits at odd bit positions (1,3,5) are assigned to the COUTx compare outputs. TRENx = 0 : Compare channel output provides CAPCOM output signal in trap state. TRENx = 1 : Compare channel output is enabled to set the logic level of the compare output CCx or COUTx in the trap state to a logic state as defined by the corresponding bits of the COINI register. When writing TREN0-5, bit TRF should be set to 0. Otherwise, setting TREN0-5 will generate a software trap interrupt. Semiconductor Group 6-58