94/317
5 - Peripherals
5.3 PARALLEL INPUT-OUTPUT PORTS
The purpose of the parallel input-outputs is basically to make binary signals either get into or
out of the core. For the core and once initialized, they appear as a memory location that can
be written or read. But in many cases, direct byte-wide input-output is not sufficient. Bit-ori-
ented I/O is often required in systems driven by a microcontroller. This implies individually
reading or writing any of the bits of each port. In addition, some of the external signals of the
other peripherals (timers, UARTs, etc.) use an external connection without increasing the pin
count by diverting some bits from the parallel I/O ports (alternate function).
The ST7 offers a very flexible feature on its parallel I/O that it shares with many other STMi-
croelectronics families: each bit can be independently configured as either an input with two
options (with or without pull-up resistor), or an output with also two options (open-drain or
push-pull).
Some pins are also available with high-current sink drivers, like Port A of the ST72251. These
pin may sink up to 15 mA, and Port A has only one output configuration: open drain.
Selecting these options is done through registers that are associated with each port. They are
memory-mapped, and are named Option Register (OR) and Data Direction Registers (DDR).
Some pins configured as input may also be connected to the external interrupt circuitry when
the corresponding bit of the Option Register is set. This allows an interrupt request to be trig-
gered when the state of the pin goes low, rises, or falls, as configured in the Miscellaneous
Register already mentioned at the beginning of this chapter and detailed on the diagrams that
follow. However some I/O pins can’t be interrupt inputs. See the tables below for the 72251
and the 72311 I/O configurations.
5.3.1 ST72251 I/O Ports
All bits of Port A are configurable as interrupt inputs when the corresponding bit of OR is set.
The option for the edge and level of these inputs is set by the bits PEI0 and PEI1 (external in-
terrupt polarity option) of the miscellaneous register. The external interrupt source is EI0 and
its corresponding interrupt vector is in FFFAh-FFFBh.
All bits of Ports B and C are configurable as interrupt inputs when the corresponding bit of OR
is set. The option for the edge and level of these inputs is set by the bits PEI2 and PEI3 in the
same register. The external interrupt source is EI1 and its corresponding interrupt vector is in
FFF8h-FFF9h.
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...