MOTOROLA
QUEUED SERIAL MODULE
MC68336/376
9-4
USER’S MANUAL
9.2.2 QSM Pin Control Registers
The QSM uses nine pins. Eight of the pins can be used for serial communication or for
parallel I/O. Clearing a bit in the port QS pin assignment register (PQSPAR) assigns
the corresponding pin to general-purpose I/O; setting a bit assigns the pin to the QSPI.
PQSPAR does not select I/O. In master mode, PQSPAR causes a bit to be assigned
to the QSPI when SPE is set. In slave mode, the MISO pin, if assigned to the QSPI,
remains under the control of the QSPI, regardless of the SPE bit. PQSPAR does not
affect operation of the SCI.
The port QS data direction register (DDRQS) determines whether pins are inputs or
outputs. Clearing a bit makes the corresponding pin an input; setting a bit makes the
pin an output. DDRQS affects both QSPI function and I/O function. DDQS7 deter-
mines the direction of the TXD pin only when the SCI transmitter is disabled. When the
SCI transmitter is enabled, the TXD pin is an output. PQSPAR and DDRQS are 8-bit
registers located at the same word address. Table 9-1 is a summary of QSM pin func-
tions.
The port QS data register (PORTQS) latches I/O data. PORTQS writes drive pins de-
fined as outputs. PORTQS reads return data present on the pins. To avoid driving un-
defined data, first write PORTQS, then configure DDRQS.
NOTES:
1. PQS2 is a digital I/O pin unless the SPI is enabled (SPE set in SPCR1), in which case it
becomes the QSPI serial clock SCK.
2. PQS7 is a digital I/O pin unless the SCI transmitter is enabled (TE set in SCCR1), in
which case it becomes the SCI serial data output TXD.
Table 9-1 Effect of DDRQS on QSM Pin Function
QSM Pin
Mode
DDRQS Bit
Bit State
Pin Function
MISO
Master
DDQS0
0
Serial data input to QSPI
1
Disables data input
Slave
0
Disables data output
1
Serial data output from QSPI
MOSI
Master
DDQS1
0
Disables data output
1
Serial data output from QSPI
Slave
0
Serial data input to QSPI
1
Disables data input
SCK1
Master
DDQS2
—
Clock output from QSPI
Slave
—
Clock input to QSPI
PCS0/SS
Master
DDQS3
0
Assertion causes mode fault
1
Chip-select output
Slave
0
QSPI slave select input
1
Disables slave select input
PCS[1:3]
Master
DDQS[4:6]
0
Disables chip-select output
1
Chip-select output
Slave
0
Inactive
1
Inactive
TXD2
—
DDQS7
X
Serial data output from SCI
RXD
—
None
NA
Serial data input to SCI
336376UMBook Page 4 Friday, November 15, 1996 2:09 PM