Hardware Reference
In-Depth Information
Port Name
Data Register Name
PORTA 1
A
B
PORTB 1
E
PORTE 1
K
PORTK 1
H
PTH
J
PTJ
M
PTM
P
PTP
S
PTS
T
PTT
PAD1, PADO
PORTADO, PORTAD1
L
PTL 2
U
PTU 2
V
PTV 2
W
PTW 2
Note: 1. PORTA, PORTB, PORTE, and PORTK are also
referred to as PTA, PTB, PTE, and PTK in the hcs12.inc
and hcs12.h fi les
2. Port L, U, V, and W are available in H-family devices only
Table 4.6 HCS12 parallel I/O port data register names
The following instruction reads a value from Port E and places the value in accumulator A:
ldaa PTE
The HCS12 port data register names are listed in Table 4.6.
4.11 Simple I/O Devices
Many embedded systems only require simple output devices such as switches, light-
emitting diodes, keypads, and seven-segment displays.
4.11.1 Interfacing with LEDs
The LED is often used to indicate the system operation mode, whether power is turned on,
whether system operation is normal, and so forth. An LED can illuminate when it is forward
biased and has sufficient current flowing through it. The current required to light an LED may
range from a few to more than 10 mA. The forward voltage drop across the LED can range from
about 1.6 V to more than 2.2 V.
Figure 4.15 suggests three methods for interfacing with LEDs. Methods (a) and (b) are recom-
mended for use with LEDs that need only 1 or 2 mA to produce enough brightness. The circuit (c) is
recommended for use with LEDs that need larger current to light. Resistors R 1 , R 2 , and R 3 are referred
to as current-limiting resistors because they set the magnitude of the current flowing through the
LED. The current-limiting resistor for circuits (a) and (b) should be larger (between 1.5 k
Ω
to 2 k
Ω
).
 
Search WWH ::




Custom Search