03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TIMER/COUNTER UNIT<br />

The timer counting from its initial count (usually zero) to its maximum count (either Maxcount<br />

Compare A or B) and resetting to zero defines one timing cycle. A Maxcount Compare value of<br />

0 implies a maximum count of 65536, a Maxcount Compare value of 1 implies a maximum count<br />

of 1, etc.<br />

Only equivalence between the Timer Count and Maxcount Compare registers is checked. The<br />

count does not reset to zero if its value is greater than the maximum count. If the count value exceeds<br />

the Maxcount Compare value, the timer counts to 0FFFFH, increments to zero, then counts<br />

to the value in the Maxcount Compare register. Upon reaching a maximum count value, the Maximum<br />

Count (MC) bit in the Timer Control register sets. The MC bit must be cleared by writing<br />

to the Timer Control register. This is not done automatically.<br />

The Timer/Counter Unit can be configured to execute different counting sequences. The timers<br />

can operate in single maximum count mode (all timers) or dual maximum count mode (Timers 0<br />

and 1 only). They can also be programmed to run continuously in either of these modes. The Alternate<br />

(ALT) bit in the Timer Control register determines the counting modes used by Timers 0<br />

and 1.<br />

All timers can use single maximum count mode, where only Maxcount Compare A is used. The<br />

timer will count to the value contained in Maxcount Compare A and reset to zero. Timer 2 can<br />

operate only in this mode.<br />

Timers 0 and 1 can also use dual maximum count mode. In this mode, Maxcount Compare A and<br />

Maxcount Compare B are both used. The timer counts to the value contained in Maxcount Compare<br />

A, resets to zero, counts to the value contained in Maxcount Compare B, and resets to zero<br />

again. The Register In Use (RIU) bit in the Timer Control register indicates which Maxcount<br />

Compare register is currently in use.<br />

The timers can be programmed to run continuously in single maximum count and dual maximum<br />

count modes. The Continuous (CONT) bit in the Timer Control register determines whether a<br />

timer is disabled after a single counting sequence.<br />

9.2.3.1 Retriggering<br />

The timer input pins affect timer counting in three ways (see Table 9-2). The programming of the<br />

External (EXT) and Retrigger (RTG) bits in the Timer Control register determines how the input<br />

signals are used. When the timers are clocked internally, the RTG bit determines whether the input<br />

pin enables timer counting or retriggers the current timing cycle.<br />

When the EXT and RTG bits are clear, the timer counts internal timer events. In this mode, the<br />

input is level-sensitive, not edge-sensitive. A low-to-high transition on the timer input is not required<br />

for operation. The input pin acts as an external enable. If the input is high, the timer will<br />

count through its sequence, provided the timer remains enabled.<br />

9-13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!