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

MC68331CFC16 参数 Datasheet PDF下载

MC68331CFC16图片预览
型号: MC68331CFC16
PDF下载: 下载PDF文件 查看货源
内容描述: 用户手册 [User’s Manual]
分类和应用: 微控制器和处理器外围集成电路时钟
文件页数/大小: 254 页 / 1319 K
品牌: MOTOROLA [ MOTOROLA ]
 浏览型号MC68331CFC16的Datasheet PDF文件第165页浏览型号MC68331CFC16的Datasheet PDF文件第166页浏览型号MC68331CFC16的Datasheet PDF文件第167页浏览型号MC68331CFC16的Datasheet PDF文件第168页浏览型号MC68331CFC16的Datasheet PDF文件第170页浏览型号MC68331CFC16的Datasheet PDF文件第171页浏览型号MC68331CFC16的Datasheet PDF文件第172页浏览型号MC68331CFC16的Datasheet PDF文件第173页  
7.8.1 Timer Counter  
The timer counter (TCNT) is the key timing component in the capture/compare unit.  
The timer counter is a 16-bit free-running counter that starts counting after the proces-  
sor comes out of reset. The counter cannot be stopped during normal operation. After  
reset, the GPT is configured to use the system clock divided by four as the input to the  
counter. The prescaler divides the system clock and provides selectable input fre-  
quencies. User software can configure the system to use one of seven prescaler out-  
puts or an external clock.  
The counter can be read any time without affecting its value. Because the GPT is in-  
terfaced to the IMB and the IMB supports a 16-bit bus, a word read gives a coherent  
value. If coherency is not needed, byte accesses can be made. The counter is set to  
$0000 during reset and is normally a read-only register. In test mode and freeze mode,  
any value can be written to the timer counter.  
When the counter rolls over from $FFFF to $0000, the timer overflow flag (TOF) in tim-  
er interrupt flag register 2 (TFLG2) is set. An interrupt can be enabled by setting the  
corresponding interrupt enable bit (TOI) in timer interrupt mask register 2 (TMSK2).  
Refer to 7.4.2 GPT Interrupts for more information.  
7
7.8.2 Input Capture Functions  
All GPT input capture functions use the same 16-bit timer counter (TCNT). Each input  
capture pin has a dedicated 16-bit latch and input edge-detection/selection logic. Each  
input capture function has an associated status flag, and can cause the GPT to make  
an interrupt service request.  
When a selected edge transition occurs on an input capture pin, the associated 16-bit  
latch captures the content of TCNT and sets the appropriate status flag. An interrupt  
request can be generated when the transition is detected.  
Edge-detection logic consists of control bits that enable edge detection and select a  
transition to detect. The EDGxA and EDGxB bits in timer control register 2 (TCTL2)  
determine whether the input capture functions detect rising edges only, falling edges  
only, or both rising and falling edges. Clearing both bits disables the input capture  
function. Input capture functions operate independently of each other and can capture  
the same TCNT value if individual input edges are detected within the same timer  
count cycle.  
Input capture interrupt logic includes a status flag, which indicates that an edge has  
been detected, and an interrupt enable bit. An input capture event sets the ICxF bit in  
the timer interrupt flag register 1 (TFLG1) and causes the GPT to make an interrupt  
request if the corresponding ICxI bit is set in the timer interrupt mask register 1  
(TMSK1). If the ICxI bit cleared, software must poll the status flag to determine that an  
event has occurred. Refer to 7.4 Polled and Interrupt-Driven Operation for more in-  
formation.  
Input capture events are generally asynchronous to the timer counter. Because of this,  
input capture signals are conditioned by a synchronizer and digital filter. Events are  
MC68331  
GENERAL-PURPOSE TIMER  
MOTOROLA  
7-11  
USER’S MANUAL  
 复制成功!