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 input pins for Timers 0 and 1 provide an alternate method for enabling and disabling timer<br />

counting. When using internal clocking, the input pin can be programmed either to enable the timer<br />

or to reset the timer count, depending on the state of the Retrigger (RTG) bit in the control register.<br />

When used as an enable function, the input pin either allows (input high) or prevents (input<br />

low) timer counting. To ensure recognition of an input level, it must be valid for four CPU clocks.<br />

This is due to the counter element’s time-multiplexed servicing scheme for the timers.<br />

9.2.6 Timer Interrupts<br />

All timers can generate internal interrupt requests. Although all three timers share a single interrupt<br />

request to the CPU, each has its own vector location and internal priority. Timer 0 has the<br />

highest interrupt priority and Timer 2 has the lowest.<br />

Timer Interrupts are enabled or disabled by the Interrupt (INT) bit in the Timer Control register.<br />

If enabled, an interrupt is generated every time a maximum count value is reached. In dual maximum<br />

count mode, an interrupt is generated each time the value in Maxcount Compare A or Maxcount<br />

Compare B is reached. If the interrupt is disabled after a request has been generated, but<br />

before a pending interrupt is serviced, the interrupt request remains active (the Interrupt Controller<br />

latches the request). If a timer generates a second interrupt request before the CPU services<br />

the first interrupt request, the first request is lost.<br />

9.2.7 Programming Considerations<br />

Timer registers can be read or written whether the timer is operating or not. Since processor accesses<br />

to timer registers are synchronized with counter element accesses, a half-modified count<br />

register will never be read.<br />

When Timer 0 and Timer 1 use an internal clock source, the input pin must be high to enable<br />

counting.<br />

9.3 TIMING<br />

Certain timing considerations need to be made with the Timer/Counter Unit. These include input<br />

setup and hold times, synchronization and operating frequency.<br />

9.3.1 Input Setup and Hold Timings<br />

To ensure recognition, setup and hold times must be met with respect to CPU clock edges. The<br />

timer input signal must be valid T CHIS before the rising edge of CLKOUT and must remain valid<br />

T CHIH after the same rising edge. If these timing requirements are not met, the input will not be<br />

recognized until the next clock edge.<br />

9-16

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

Saved successfully!

Ooh no, something went wrong!