General-Purpose I/O Pins
8-17
On-Chip Peripherals
8.6
General-Purpose I/O Pins
The ’C2xx provides pins that can be used to supply input signals from an exter-
nal device or output signals to an external device. These pins are not bound
to specific uses; rather, they can provide input or output signals for a great vari-
ety purposes. You have access to the general-purpose input pin BIO and the
general-purpose output pin XF. On ’C2xx devices other than the ’C209, you
also have the pins IO0, IO1, IO2, and IO3, which can each be configured as
an input pin or an output pin.
8.6.1
Input Pin BIO
The general-purpose input pin BIO pin provides input from an external device
and is particularly helpful as an alternative to an interrupt when time-critical
loops must not be disturbed. The BIO signal gives you control through three
instructions, a conditional branch (BCND), a conditional call (CC), and a condi-
tional return (RETC). Here is an example of each:
-
BCND
pma, BIO
pma is a program memory address that you specify. The CPU branches to
the program memory address if BIO is low.
-
CC
pma, BIO
pma is a program memory address that you specify. If BIO is low, the CPU
stores the return address to the top of the hardware stack and then
branches to the program memory address.
-
RETC
BIO
If BIO is low, the CPU transfers the return address from the stack to the
program counter (PC) to return from a subroutine or interrupt service rou-
tine.
If BIO is not used, it should be pulled high so that a conditional branch, call,
or return will not be executed accidentally.
An example of BIO timing is shown in Figure 8–7. This timing diagram is for
a sequence of single-cycle, single-word instructions located in external
memory. BIO must be asserted low for at least one CLKOUT1 cycle. The
BCND, CC, and RETC instructions sample the BIO pin during their execute
phase in the pipeline. Actual timing may vary with different instruction se-
quences.