GENERAL-PURPOSE I/O (PORT C)
MOTOROLA
PORT C
6 - 9
The NOP can be replaced by any instruction that allows parallel moves. Inserting one or
more “MOVE DATA15,X:PORTC DATA24,Y:EXTERN” instructions between the first and
second instruction produces an external 33-bit write each instruction cycle with only one
instruction cycle lost in setup time:
MOVE
DATA9,X:PORTC
MOVE
DATA9,X:PORTC
DATA24,Y:EXTERN
MOVE
DATA9,X:PORTC
DATA24,Y:EXTERN
:
:
MOVE
DATA9,X:PORTC
DATA24,Y:EXTERN
NOP
DATA24,Y:EXTERN
One application of this technique is to create an extended address for Port A by concate-
nating the Port A address bits (instead of data bits) to the Port C general-purpose output
bits. The Port C general-purpose I/O register would then work as a base address register,
allowing the address space to be extended from 64K words (16 bits) to 33.5 million words
CC
1
CD
0
CD
1
CD
2
CD
3
CD
4
CD
5
CD
6
CD
7
CD
8
PC
0
PC
1
PC
2
PC
3
PC
4
PC
5
PC
6
PC
7
PC
8
STEP 1. SELECT EACH PIN TO BE GENERAL-PURPOSE I/O OR AN ON-CHIP PERIPHERAL PIN:
CCx = 0
GENERAL- PURPOSE I/O
CCx = 1
ON-CHIP PERIPHERAL
X:$FFE1
8
0
PORT C CONTROL REGISTER (PCC)
X:$FFE3
PORT C DATA DIRECTION REGISTER (PCDDR)
8
0
STEP 2. SET EACH GENERAL - PURPOSE I/O PIN (SELECTED ABOVE) AS INPUT OR OUTPUT:
CDx = 0
INPUT PIN
OR
CDx = 1
OUTPUT PIN
8
0
X:$FFE5
PORT C DATA REGISTER (PCD)
STEP 3. READ/WRITE GENERAL - PURPOSE I/O PINS:
PCx = OUTPUT DATA IF SELECTED FOR GENERAL - PURPOSE I/O AND OUTPUT IN STEPS 1 AND 2.
OR
PCx = INPUT DATA IF SELECTED FOR GENERAL - PURPOSE I/O AND INPUT IN STEPS 1 AND 2.
CC
2
CC
3
CC
4
CC
5
CC
6
CC
7
CC
8
CC
0
Figure 6-7 I/O Port C Configuration
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
.
..