English
Language : 

MC68HC16Z1CAG16 Datasheet, PDF (214/500 Pages) Freescale Semiconductor, Inc – M68HC16Z Series users manual
Freescale Semiconductor, Inc.
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 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.
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.
PQSPAR and DDRQS are 8-bit registers located at the same word address. Refer to
Table 9-1 for a summary of QSM pin functions.
Table 9-1 Effect of DDRQS on QSM Pin Function
QSM Pin
MISO
MOSI
QSPI Mode DDRQS Bit
Master
DDQS0
Slave
Master
DDQS1
Bit State
0
1
0
1
0
1
Pin Function
Serial data input to QSPI
Disables data input
Disables data output
Serial data output from QSPI
Disables data output
Serial data output from QSPI
Slave
0
1
SCK1
Master
DDQS2
—
Slave
—
PCS0/SS
Master
DDQS3
0
1
Slave
0
1
PCS[1:3]
Master DDQS[4:6]
0
Serial data input to QSPI
Disables data input
Clock output from QSPI
Clock input to QSPI
Assertion causes mode fault
Chip-select output
QSPI slave select input
Disables slave select input
Disables chip-select output
1
Slave
0
1
TXD2
—
DDQS7
X
RXD
—
None
NA
Chip-select output
Inactive
Inactive
Serial data output from SCI
Serial data input to SCI
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.
QUEUED SERIAL MODULE
M68HC16 Z SERIES
9-4
For More Information On This Product,
USER’S MANUAL
Go to: www.freescale.com