ht82k70e-l Holtek Semiconductor Inc., ht82k70e-l Datasheet - Page 17

no-image

ht82k70e-l

Manufacturer Part Number
ht82k70e-l
Description
I/o Type 8-bit Otp Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
will be in an unknown condition. Note that if the
Timer/Event Counter is switched off and data is written
to its preload registers, this data will be immediately writ-
ten into the actual timer registers. However, if the
Timer/Event Counter is enabled and counting, any new
data written into the preload data registers during this
period will remain in the preload registers and will only
be written into the timer registers the next time an over-
flow occurs.
For the 16-bit Timer/Event Counter which has both low
byte and high byte timer registers, accessing these reg-
isters is carried out in a specific way. It must be note
when using instructions to preload data into the low byte
timer register, namely TMR0L/TMR1L, the data will only
be placed in a low byte buffer and not directly into the
low byte timer register. The actual transfer of the data
into the low byte timer register is only carried out when a
write to its associated high byte timer register, namely
TMR0H/TMR1H, is executed. On the other hand, using
instructions to preload data into the high byte timer reg-
ister will result in the data being directly written to the
high byte timer register. At the same time the data in the
low byte buffer will be transferred into its associated low
byte timer register. For this reason, the low byte timer
register should be written first when preloading data into
the 16-bit timer registers. It must also be noted that to
read the contents of the low byte timer register, a read to
the high byte timer register must be executed first to
latch the contents of the low byte timer register into its
Rev. 1.00
16-bit Timer/Event Counter 0 Structure
16-bit Timer/Event Counter 1 Structure
17
associated low byte buffer. After this has been done, the
low byte timer register can be read in the normal way.
Note that reading the low byte timer register will result in
reading the previously latched contents of the low byte
buffer and not the actual contents of the low byte timer
register.
Timer Control Register - TMR0C, TMR1C
The flexible features of the Holtek microcontroller
Timer/Event Counters enable them to operate in three
different modes, the options of which are determined by
the contents of their control register, which has the
name TMR0C or TMR1C. It is the Timer Control Regis-
ter together with its corresponding timer register that
control the full operation of the Timer/Event Counter.
Before the Timer/Event Counter can be used, it is es-
sential that the Timer Control Register is fully pro-
grammed with the right data to ensure its correct
operation, a process that is normally carried out during
program initialisation.
To choose which of the three modes the Timer/Event
Counter is to operate in, either in the timer mode, the
event counting mode or the pulse width measurement
mode, bits 7 and 6 of the Timer Control Register, which
are known as the bit pair T0M1/T0M0 or T1M1/T1M0,
must be set to the required logic levels. The Timer/Event
Counter on/off bit, which is bit 4 of the Timer Control
Register and known as T0ON or T1ON, provides the ba-
sic on/off control of the Timer/Event Counter. Setting the
HT82K70E-L/HT82K76E-L
September 15, 2009

Related parts for ht82k70e-l