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 />

9.3.2 Synchronization and Maximum Frequency<br />

All timer inputs are latched and synchronized with the CPU clock. Because of the internal logic<br />

required to synchronize the external signals, and the multiplexing of the counter element, the<br />

Timer/Counter Unit can operate only up to ¼ of the CLKOUT frequency. Clocking at greater frequencies<br />

will result in missed clocks.<br />

9.3.2.1 Timer/Counter Unit Application Examples<br />

The following examples are possible applications of the Timer/Counter Unit. They include a realtime<br />

clock, a square wave generator and a digital one-shot.<br />

9.3.3 Real-Time Clock<br />

Example 9-1 contains sample code to configure Timer 2 to generate an interrupt request every 10<br />

milliseconds. The CPU then increments memory-based clock variables.<br />

9.3.4 Square-Wave Generator<br />

A square-wave generator can be useful to act as a system clock tick. Example 9-2 illustrates how<br />

to configure Timer 1 to operate this way.<br />

9.3.5 Digital One-Shot<br />

Example 9-3 configures Timer 1 to act as a digital one-shot.<br />

9-17

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

Saved successfully!

Ooh no, something went wrong!