参数资料
型号: SAB-C515-L24N
厂商: INFINEON TECHNOLOGIES AG
元件分类: 微控制器/微处理器
英文描述: 8-BIT, 24 MHz, MICROCONTROLLER, PQCC68
封装: PLASTIC, LCC-68
文件页数: 133/162页
文件大小: 771K
代理商: SAB-C515-L24N
Semiconductor Group
6-29
On-Chip Peripheral Components
C515
6.2.2.2
Timer 2 Operation
The timer 2, which is a 16-bit-wide register, can operate as timer, event counter, or gated timer. The
detailed operation is described below.
Timer Mode
In timer function, the count rate is derived from the oscillator frequency. A prescaler offers the
possibility of selecting a count rate of 1/12 or 1/24 of the oscillator frequency. Thus, the 16-bit timer
register (consisting of TH2 and TL2) is either incremented in every machine cycle or in every second
machine cycle. The prescaler is selected by bit T2PS in special function register T2CON. lf T2PS is
cleared, the input frequency is 1/12 of the oscillator frequency. if T2PS is set, the 2:1 prescaler gates
1/24 of the oscillator frequency to the timer.
Gated Timer Mode
In gated timer function, the external input pin P1.7 / T2 functions as a gate to the input of timer 2. lf
T2 is high, the internal clock input is gated to the timer. T2 = 0 stops the counting procedure. This
facilitates pulse width measurements. The external gate signal is sampled once every machine
cycle.
Event Counter Mode
In the counter function, the timer 2 is incremented in response to a 1-to-0 transition at its
corresponding external input pin P1.7 / T2 In this function, the external input is sampled every
machine cycle. When the sampled inputs show a high in one cycle and a low in the next cycle, the
count is incremented. The new count value appears in the timer register in the cycle following the
one in which the transition was detected. Since it takes two machine cycles (24 oscillator periods)
to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. There
are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is
sampled at least once before it changes, it must be held for at least one full machine cycle.
Note: The prescaler must be off for proper counter operation of timer 2, i.e. T2PS must be 0.
In either case, no matter whether timer 2 is configured as timer, event counter, or gated timer, a
rolling-over of the count from all 1’s to all 0’s sets the timer overflow flag TF2 in SFR IRCON, which
can generate an interrupt.
lf TF2 is used to generate a timer overflow interrupt, the request flag must be cleared by the interrupt
service routine as it could be necessary to check whether it was the TF2 flag or the external reload
request flag EXF2 which requested the interrupt. Both request flags cause the program to branch to
the same vector address.
相关PDF资料
PDF描述
SAF-C515-RM 8-BIT, OTPROM, 16 MHz, MICROCONTROLLER, PQFP80
SAF-C515-LN 8-BIT, 16 MHz, MICROCONTROLLER, PQCC68
SAH-C515-LN 8-BIT, 16 MHz, MICROCONTROLLER, PQCC68
SAB-C515-LM 8-BIT, 16 MHz, MICROCONTROLLER, PQFP80
SAB-C515C-LM 8-BIT, 10 MHz, MICROCONTROLLER, PQFP80
相关代理商/技术参数
参数描述
SAB-C515-LM 制造商:INFINEON 制造商全称:Infineon Technologies AG 功能描述:8-Bit CMOS Microcontroller
SAB-C517A 制造商:INFINEON 制造商全称:Infineon Technologies AG 功能描述:8-bit CMOS MICROCONTROLLER
SAB-C517A-4R24M 制造商:INFINEON 制造商全称:Infineon Technologies AG 功能描述:8-Bit CMOS Microcontroller
SAB-C517A-4RM 制造商:INFINEON 制造商全称:Infineon Technologies AG 功能描述:8-Bit CMOS Microcontroller
SAB-C517A-L24M 制造商:INFINEON 制造商全称:Infineon Technologies AG 功能描述:8-Bit CMOS Microcontroller