MC68HC05T16
MOTOROLA
5-3
TIMERS
5
5.1.1
Counter
–
Counter Register location
High byte - $18, Low byte - $19
–
Alternate Counter Register
High byte - $1A, Low byte - $1B
The key element in the programmable timer is a 16-bit, free-running counter or counter register,
preceded by a prescaler that divides the internal processor clock by four. The prescaler gives the
timer a resolution of 0.95
µ
s if the internal bus clock is 4.2MHz. The counter is incremented during
the low portion of the internal bus clock. Software can read the counter at any time without
affecting its value.
The double-byte, free-running counter can be read from either of two locations, $18 and $19
(counter register) or $1A and $1B (counter alternate register). Reading only the least significant
byte (LSB) of the free-running counter ($19 or $1B) receives the count value at the time of the
read. If the most significant byte (MSB) ($18 or $1A) is read first, the LSB ($19 or $1B) is
transferred to a buffer. This buffer value remains fixed after the first MSB read, even if the MSB is
read several times. This buffer is accessed when the LSB ($19 or $1B) is read, and thus,
completes a read sequence of the complete counter value.
Reading the Timer Counter register low byte after reading the timer Status Register clears the
timer overflow flag (TOF), but reading the Counter Alternate register does not affect TOF.
Therefore, the counter alternate register can be read any time without risk of missing timer
overflow interrupts due to a cleared TOF.
The free-running counter is preset to $FFFC during reset and is always a read-only register.
During a power-on reset, the counter is also preset to $FFFC and begins running after the
oscillator start-up delay. The value in the free-running counter repeats every 262144 internal bus
clock cycles. TOF is set when the counter overflows (from $FFFF to $0000); this will cause an
interrupt if TOVFIE (bit 4 of Timer Control register) is set.
In some timing control applications it may be desirable to reset the counter under software control.
When the low byte of the counter ($19 or $1B) is written to, the counter is set to its reset value of
$FFFC. The divide-by-4 prescaler is also reset and the counter resumes normal counting
operation. All of the flags and enable bits remain unaltered by this operation. If access has
previously been made to the high byte of the free-running counter ($18 or $1A), then the reset
counter operation terminates the access sequence.
5.1.2
Output Compare Registers
There are two 16-bit Output Compare registers:
–
Output Compare 0 Register
High byte - $14, Low byte - $15
–
Output Compare 1 Register
High byte - $16, Low byte - $17
Each 16-bit Output Compare register is made up of two 8-bit registers. These Output Compare
registers are used for several purposes, such as indicating when a period of time has elapsed. All
TPG
43
Содержание MC68HC05T16
Страница 2: ......
Страница 14: ...MOTOROLA vi MC68HC05T16 THIS PAGE LEFT BLANK INTENTIONALLY TPG 12 ...
Страница 16: ...MOTOROLA viii MC68HC05T16 THIS PAGE LEFT BLANK INTENTIONALLY TPG 14 ...
Страница 18: ...MOTOROLA x MC68HC05T16 THIS PAGE LEFT BLANK INTENTIONALLY TPG 16 ...
Страница 26: ...MOTOROLA 2 6 MC68HC05T16 PIN DESCRIPTIONS AND INPUT OUTPUT PORTS 2 THIS PAGE LEFT BLANK INTENTIONALLY TPG 24 ...
Страница 54: ...MOTOROLA 5 12 MC68HC05T16 TIMERS 5 THIS PAGE LEFT BLANK INTENTIONALLY TPG 52 ...
Страница 64: ...MOTOROLA 6 10 MC68HC05T16 M BUS SERIAL INTERFACE 6 THIS PAGE LEFT BLANK INTENTIONALLY TPG 62 ...
Страница 92: ...MOTOROLA 10 4 MC68HC05T16 ANALOG TO DIGITAL CONVERTER 10 THIS PAGE LEFT BLANK INTENTIONALLY TPG 90 ...
Страница 106: ...MOTOROLA 11 14 MC68HC05L1 CPU CORE AND INSTRUCTION SET 11 THIS PAGE LEFT BLANK INTENTIONALLY TPG 104 ...
Страница 110: ...MOTOROLA 12 4 MC68HC05T16 LOW POWER MODES 12 THIS PAGE LEFT BLANK INTENTIONALLY TPG 108 ...
Страница 116: ...MOTOROLA 13 6 MC68HC05T16 OPERATING MODES 13 THIS PAGE LEFT BLANK INTENTIONALLY TPG 114 ...
Страница 122: ...MOTOROLA 14 6 MC68HC05T16 ELECTRICAL SPECIFICATIONS 14 THIS PAGE LEFT BLANK INTENTIONALLY TPG 120 ...
Страница 124: ...MOTOROLA 15 2 MC68HC05T16 MECHANICAL SPECIFICATIONS 15 THIS PAGE LEFT BLANK INTENTIONALLY TPG 122 ...
Страница 127: ...2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 ...