an1238.pdf

(27 KB) Pobierz
Order this document
by AN1238/D
MOTOROLA
SEMICONDUCTOR
APPLICATION NOTE
AN1238
HC05 MCU LED Drive Techniques
Using the MC68HC705J1A
By David Yoder
CSIC Applications
INTRODUCTION
This application note demonstrates how the high-current sink pins of an MC68HC705J1A drive a light-
emitting diode (LED) directly without requiring an external amplifying transistor.
The math used to determine the current-limiting resistor value is valid for any HC05 MCU port pin
regardless of the pin’s output low current (I
OL
) rating. Only the maximum I
OL
specification need be
changed in the equations.
BACKGROUND
Normal HCMOS I/O pins have sufficient current to drive a reasonable fan-out of HCMOS or TTL inputs.
These pins are commonly specified to sink 1.6 mA with an output low voltage of 0.4 V. However, in cases
when an HCMOS output is used to drive a device requiring significantly more current, these port pins are
not sufficient. Examples include an LED, optoisolator and the first stage of an amplifier, each of which often
require up to 10 mA.
The MC68HC705J1A has four input/output (I/O) pins (ports A4-A7) that are rated to sink 10 mA with a
output low voltage (V
OL
) of 0.4 V, which easily can accommodate drive requirements of LEDs and other
devices. An example LED drive schematic is shown below.
V
DD
MC68HC705J1A
R
PA4
©MOTOROLA INC., 1995
AN1238/D
DETERMINING RESISTOR VALUE
To find a first approximation for R, use Ohms Law and divide the power supply voltage by the current to be
sunk:
R=
V
DD
I
OL
Using a V
DD
of 5 V and a I
OL
of 10 mA, the result is a 500-Ω resistor. Although this is a simplistic approach,
by using it the 10 mA specification will not be exceeded. Due to other voltage drops, (the LED forward
voltage and the port V
OL
), the actual voltage across the resistor will be much less. Consequently, the
current will be much less.
Taking those drops into account:
R=
V
DD
— V
f,LED
— V
OL
I
OL
The effect of varying values must be considered also. To remain at 10 mA or less, use the extreme value
that will cause the most current to be drawn, and the equation becomes:
V
DD,MAX
— V
f,LED,MIN
— V
OL,MIN
R
MIN
=
I
OL,MAX
This equation gives the minimum resistor value, R
MIN
. Resistors are rated by tolerance:
R
MIN
= R — tol x R
R=
R
MIN
1 — tol
R
MIN
can now be substituted to arrive at:
V
DD,MAX
— V
f,LED,MIN
— V
OL,MIN
R=
(1 — tol) x I
OL,MAX
Where:
1) R
2) V
DD,MAX
3) V
f,LED,MIN
4) V
OL,MIN
5) tol
6) I
OL,MAX
Resistor Center Value
Maximum Power Supply Voltage
Minimum LED Forward Voltage at I
OL,MAX
Minimum Output Low Voltage from MCU at I
OL,MAX
Tolerance of Resistor — .05, .10, or .20
Maximum Current to be Allowed
Most of these can be read from a data sheet. However, V
OL,MIN
is not known. The part specification uses
0.4 V for V
OL,MAX
. Since minimum is needed for the worst-case current sink, the safest number to use is 0
V, although measurement will show a value closer to 0.1 V.
5 Volt Resistor Value
For V
DD
= 5 V 10%, V
LED,MIN
= 1.8 V, V
OL,MIN
= 0 V, tol = 5%, I
OL,MAX
= 10 mA
The nominal R value is 389 . The next larger value commonly available is 390 .
MOTOROLA
2
AN1238/D
3.3 Volt Resistor Value
For V
DD
= 3.3 V 10%, V
LED,MIN
= 1.8 V, V
OL,MIN
= 0 V, tol = 5%, I
OL,MAX
= 5 mA
The nominal R value is 385 . The next larger value commonly available is 390 .
CONCLUSION
A much smaller resistor — and, therefore, a brighter LED — than the first approximation can be used while
maintaining assurance that I
OL,MAX
specifications will not be violated.
Also, the equations given here are valid for any port pin. Simply use the appropriate values for I
OL,MAX
and
V
OL,MIN
. Although a normal port pin would be able to sink less current, the design rules hold true.
AN1238/D
MOTOROLA
3
Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of its products for any par ticular pur pose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters can and do vary in different applications. All operating
parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent
rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or
other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or
death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its
officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly
or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the
design or manufacture of the part. Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
Literature Distribution Centers:
USA: Motorola Literature Distribution; P.O. Box 20912; Phoenix, Arizona 85036.
EUROPE: Motorola Ltd.; European Literature Centre; 88 Tanners Drive, Blakelands, Milton Keynes, MK14 5BP England.
,
JAPAN: Nippon Motorola Ltd.; 4-32-1, Nishi-Gotanda, Shinagawa-ku, Tokyo 141 Japan.
ASIA-PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Center, No.2 Dai King Street, Tai Po Industrial Estate,
Tai Po, N.T., Hong Kong.
AN1238/D
Zgłoś jeśli naruszono regulamin