GENERAL-PURPOSE I/O (PORT C)
6 - 6
PORT C
MOTOROLA
6.2.1
Programming General Purpose I/O
Port C and all the DSP56002 peripherals are memory mapped (see Figure 6-5). The stan-
dard MOVE instruction transfers data between Port C and a register; as a result, perform-
ing a memory-to-memory data transfer takes two MOVE instructions and a register. The
MOVEP instruction is specifically designed for I/O data transfer as shown in Figure 6-6.
Although the MOVEP instruction may take twice as long to execute as a MOVE instruc-
tion, only one MOVEP is required for a memory-to-memory data transfer, and MOVEP
does not use a temporary register. Using the MOVEP instruction allows a fast interrupt to
move data to/from a peripheral to memory and execute one other instruction or to move
the data to an absolute address. MOVEP is the only memory-to-memory move instruction;
however, one of the operands must be in the top 64 locations of either X: or Y: memory.
The bit-oriented instructions which use I/O short addressing (BCHG, BCLR, BSET, BTST,
JCLR, JSCLR, JSET, and JSSET) can also be used to address individual bits for faster
PORT
REGISTERS
INPUT DATA BIT
DATA DIRECTION BIT
OUTPUT DATA BIT
PORT INPUT DATA BIT
Port Control
Register Bit
Data Direction
Register Bit
Pin Function
0
0
Port Input Pin
PIN
PORT C DATA (PCD)
REGISTER BIT
DATA DIRECTION
REGISTER (PCDDR)
PORT C CONTROL
(PCC) REGISTER BIT
(GPIO
POSITION)
(INPUT
POSITION)
PERIPHERAL
LOGIC
Figure 6-4 Port C I/O Pin Control Logic
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..