欢迎访问ic37.com |
会员登录 免费注册
发布采购

MPC82G516A 参数 Datasheet PDF下载

MPC82G516A图片预览
型号: MPC82G516A
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器 [8-bit microcontroller]
分类和应用: 微控制器
文件页数/大小: 144 页 / 1527 K
品牌: MEGAWIN [ MEGAWIN TECHNOLOGY CO., LTD ]
 浏览型号MPC82G516A的Datasheet PDF文件第36页浏览型号MPC82G516A的Datasheet PDF文件第37页浏览型号MPC82G516A的Datasheet PDF文件第38页浏览型号MPC82G516A的Datasheet PDF文件第39页浏览型号MPC82G516A的Datasheet PDF文件第41页浏览型号MPC82G516A的Datasheet PDF文件第42页浏览型号MPC82G516A的Datasheet PDF文件第43页浏览型号MPC82G516A的Datasheet PDF文件第44页  
11 Timers/Counters  
The MPC82G516A has three 16-bit Timer/Counters: Timer 0, Timer 1 and Timer 2. Each consists of two 8-bit  
registers, THx and TLx (where, x= 0, 1, or 2). All of them can be configured to operate either as timers or event  
counters.  
In the Timer function, the TLx register is incremented every 12-clock cycle or 1-clock cycle, which is selectable by  
software. Thus one can think of it as counting clock cycles. When counting every 12 clock cycles, the count rate  
is 1/12 of the oscillator frequency.  
In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external  
input pin- T0, T1, or T2. In this function, the external input is sampled every clock cycle for T0 pin and T1 pin, and  
12-clock cycle for T2 pin. When the samples show a high and then a low, the count is incremented. The new  
count value appears in the register when the transition was detected. For Timer 0 and Timer1, it takes 2 clock  
cycles to recognize a 1-to-0 transition, the maximum count rate is 1/2 of the oscillator frequency; for Timer 2, it  
takes 24 clock cycles 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 should be held for at least one clock cycle for Timer 0 and Timer 1, and 12-  
clock cycles for Timer 2.  
For Timer 0 and Timer 2, in addition to their standard 8051’s timer function, some special new functions are  
added in. The following sub-sections will describe these timer/counters in detail.  
11.1 Timer 0 and Timer 1  
The Timer or Counter function is selected by control bits C/-T in the Special Function Register TMOD, as shown  
below. These two Timer/Counters have four operating modes, which are selected by bit-pairs (M1, M0) in TMOD.  
Mode 0, 1 and 2 are the same for these two Timer/Counters. Mode 3 is different. In addition to TMOD, another  
Special Function Registers TCON and AUXR2 contains several control bits and status flags related to these two  
Timers, as also shown below.  
TMOD (Address=89H, Timer/Counter Mode Control Register, Reset Value=0000,0000B)  
Timer 1  
Timer 0  
7
6
5
4
3
2
1
0
GATE  
C/-T  
M1  
M0  
GATE  
C/-T  
M1  
M0  
GATE: Gating control when set. Timer/Counter 0 or 1 is enabled only while /INT0 or /INT1 pin is high and TR0 or  
TR1 control pin is set. When cleared, Timer 0 or 1 is enabled whenever TR0 or TR1 control bit is set.  
C/-T: Timer or Counter Selector. Clear for Timer operation (input from internal system clock). Set for Counter  
operation (input from T0 or T1 input pin).  
M1 M0 Operating Mode  
0
0
1
0
1
0
8-bit Timer/Counter. THx with TLx as 5-bit prescaler.  
16-bit Timer/Counter. THx and TLx are cascaded; there is no prescaler.  
8-bit auto-reload Timer/Counter. THx holds a value which is to be reloaded into TLx each time it  
overflows.  
1
1
1
1
(Timer 0) TL0 is an 8-bit Timer/Counter controlled by the standard Timer 0 control bits. TH0 is an 8-bit  
timer only controlled by Timer 1 control bits.  
(Timer 1) Timer/Counter stopped.  
MEGAWIN  
MPC82G516A Data Sheet  
40