HT46RU25 Holtek Semiconductor Inc., HT46RU25 Datasheet - Page 19

no-image

HT46RU25

Manufacturer Part Number
HT46RU25
Description
Ht46ru25/ht46cu25 -- A/d Type 8-bit Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT46RU25
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
To enable the counting operation, the Timer ON bit
(T0ON; bit 4 of the TMR0C, T1ON; bit 4 of the TMR1C,
or T2ON; bit 4 of the TMR2C) should be set to 1. In the
pulse width measurement mode, the T0ON/T1ON/
T2ON is automatically cleared after the measurement
cycle is completed. But in the other two modes, the
T0ON/T1ON/T2ON can only be reset by instructions.
The overflow of the Timer/Event Counter 0/1/2 is one of
the wake-up sources, and Timer/Event Counter 0/1 can
also be applied to a PFD (Programmable Frequency Di-
vider) output at PA3 by options. No matter what the op-
eration mode is, writing a 0 to ET0I, ET1I or ET2I
disables the related interrupt service. When the PFD
function is selected, executing the SET [PA].3 instruc-
tion will enable the PFD output and executing the CLR
[PA].3 instruction will disable the PFD output.
In the case of timer/event counter OFF condition, writing
data to the timer/event counter preload register also re-
loads 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 coun-
ter preload register. The timer/event counter still contin-
ues to operate until an overflow occurs.
Rev. 1.30
Timer/Event Counter 2
PFD Source Option
19
When the timer/event counter (reading TMR0/TMR1/
TMR2) 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. It is
strongly recommended to load a desired value into the
TMR0/TMR1/TMR2 register first, before turning on the
related timer/event counter, for proper operation since
the initial value of the TMR0/TMR1/TMR2 is unknown.
Due to the timer/event scheme, the programmer should
pay special attention on the instruction to enable then
disable the timer for the first time, whenever there is a
need to use the timer/event function, to avoid unpredict-
able result. After this procedure, the timer/event function
can be operated normally.
The bit0~bit2 of the TMR0C/TMR2C (T0PSC2~0/
T2PSC2~0) can be used to define the pre-scaling
stages of the internal clock sources of the timer/event
counter. The definitions are as shown. The overflow sig-
nal of the timer/event counter can be used to generate
the PFD signal. The timer prescaler is also used as the
PWM counter.
HT46RU25/HT46CU25
March 9, 2007

Related parts for HT46RU25