herunterladen

AN1067/D
Rev. 1, 5/2002
Pulse Generation
and Detection
with Microcontroller Units
Application Note
By Mike Pauwels
Introduction
This application note examines two common interfaces between
microcontroller units (MCUs) and external circuitry:
• Pulse generation
• Pulse detection
Several families of Freescale MCUs and a variety of pulse applications are
considered. Code segments and listings are also included.
Pulse Generation
MCUs are often required to generate timed output pulses (i.e., signals asserted
for a specified period of time). The application can be strobing a display latch,
transmitting a code, or metering a reagent in a process control system.
However, each application has specific requirements for pulse duration and
accuracy. This application note examines methods of generating these pulses
in relationship to timing accuracy, coding efficiency, and other controller
requirements.
The following paragraphs describe the timing of the signals (start time and
duration of the pulse). All pulses can be divided into three basic classifications:
• Short pulses
• Long pulses
• Easy pulses
Each class of pulse is considered using three MCUs with different timer
structures.
On the low end of the scale is the MC68HC05J1. The simple timer in this device
limits the accuracy of short pulses and requires a larger amount of software
investment to produce a given pulse. The second MCU, the MC68HC705C8
and similar devices, has a 16-bit timer that is somewhat more powerful and
Freescale Semiconductor, I
For More Information On This Product,
Go to: www.freescale.com
nc
.
..
Freescale Semiconductor
© Freescale Semiconductor, Inc., 2004. All rights reserved.