參數(shù)資料
型號: HT82A832R
廠商: Holtek Semiconductor Inc.
英文描述: Basic USB Phone OTP MCU
中文描述: 檢察官辦公室的基本USB電話單片機(jī)
文件頁數(shù): 16/51頁
文件大?。?/td> 345K
代理商: HT82A832R
HT82A832R
Rev. 1.00
16
July 18, 2006
Timer/Event Counter
Two timer/event counters (TMR0, TMR1) are
implemented in the microcontroller. The Timer/Event
Counter 0/1 contains a 16-bit programmable count-up
counter and the clock may come from an external
source or an internal clock source. An internal clock
source comes from f
SYS
/4. The external clock input
allows the user to count external events, measure time
intervals or pulse widths, or to generate an accurate
time base. There are six registers related to the
Timer/Event Counter 0; TMR0H (0CH), TMR0L (0DH),
TMR0C (0EH) and the Timer/Event Counter 1; TMR1H
(0FH), TMR1L (10H), TMR1C (11H). For 16-bit timer to
write data to TMR0/1Lwill only put the written data to an
internal lower-order byte buffer (8-bit) and writing
TMR0/1H will transfer the specified data and the
contents of the lower-order byte buffer to TMR0/1H and
TMR0/1L registers. The Timer/Event Counter 0/1
preload register is changed by each writing TMR0/1H
operations. Reading TMR0/1H will latch the contents of
TMR0/1H and TMR0/1L counters to the destination and
the lower-order byte buffer, respectively. Reading the
TMR0/1L will read the contents of the lower-order byte
buffer. The TMR0C (TMR1C) is the Timer/Event
Counter 0 (1) control register, which defines the
operating mode, counting enable or disable and an
active edge.
The TM0 and TM1 bits define the operation mode. The
event count mode is used to count external events,
which means that the clock source is from an external
(TMR0, TMR1) pin. The timer mode functions as a
normal timer with the clock source coming from the
internal clock source. Finally, the pulse width
measurement mode can be used to count the high level
or low level duration of the external signal (TMR0,
TMR1), and the counting is based on the internal clock
source.
In the event count or timer mode, the timer/event
counter starts counting at the current contents in the
timer/event counter and ends at FFFFH. Once an
overflow occurs, the counter is reloaded from the
timer/event counter preload register, and generates an
interrupt request flag (T0F; bit 5 of INTC0, T1F; bit 6 of
INTC0). In the pulse width measurement mode with the
valuesoftheTONandTEbitsequalto1,aftertheTMR0
(TMR1) has received a transient from low to high (or
high to low if the TE bit is 0 ), it will start counting until
theTMR0(TMR1)returnstotheoriginallevelandresets
TON. The measured result remains in the timer/event
counter even if the activated transient occurs again. In
other words, only 1-cycle measurement can be made
until TON is set. The cycle measurement will re-function
as long as it receives further transient pulse. In this
operation mode, the timer/event counter begins
counting not according to the logic level but to the
transient edges. In the case of counter overflows, the
counter is reloaded from the timer/event counter
register and issues an interrupt request, as in the other
two modes, i.e., event and timer modes.
To enable the counting operation, the Timer ON bit
(TON; bit 4 of TMR0C or TMR1C) should be set to 1. In
the pulse width measurement mode, TON is
automatically cleared after the measurement cycle is
completed.Butintheothertwomodes,TONcanonlybe
reset by instructions. The overflow of the Timer/Event
Counter 0/1 is one of the wake-up sources. No matter
what the operation mode is, writing a 0 to ET0I or ET1I
disables the related interrupt service.
In the case of timer/event counter off condition, writing
data to the timer/event counter preload register also
reloads that data to the timer/event counter. But if the
timer/event counter is turn on, data written to the
timer/event counter is kept only in the timer/event
counter preload register. The timer/event counter still
continues its operation until an overflow occurs.
When the timer/event counter (reading TMR0/TMR1) is
read, the clock is blocked to avoid errors, as this may
results in a counting error. Blocking of the clock should
be taken into account by the programmer.
)
) (
'
)
&
%
"
%
&
8 % ,
( ' =
%
&
%
% ,
&
=
# & ;
%
#
/
( 0
8 % ,
( ' =
%
4
) ( 6
#
Timer/Event Counter 0/1
相關(guān)PDF資料
PDF描述
HT82A850R Audio MCU
HT82A851R USB Audio MCU
HT82J30A 16 Channel A/D MCU with SPI Interface
HT82J30R 16 Channel A/D MCU with SPI Interface
HT82J927A USB Gamepad
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
HT82A832R_07 制造商:HOLTEK 制造商全稱:Holtek Semiconductor Inc 功能描述:USB Audio MCU
HT82A834R 制造商:HOLTEK 制造商全稱:Holtek Semiconductor Inc 功能描述:USB Audio MCU
HT82A836R 制造商:HOLTEK 制造商全稱:Holtek Semiconductor Inc 功能描述:USB Audio MCU
HT82A850R 制造商:HOLTEK 制造商全稱:Holtek Semiconductor Inc 功能描述:Audio MCU
HT82A851R 制造商:HOLTEK 制造商全稱:Holtek Semiconductor Inc 功能描述:USB Audio MCU