MCMC68HC05L16 Freescale Semiconductor, Inc, MCMC68HC05L16 Datasheet - Page 75

no-image

MCMC68HC05L16

Manufacturer Part Number
MCMC68HC05L16
Description
M68hc05 Microcontrollers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
8.6.3 Serial Peripheral Data Register
Read
Write
The SPDR is used to transmit and receive data on the serial bus.
In master mode, a write to this register initiates transmission/reception of a data byte.
The SPIF status bit is set at the completion of data byte transmission. A write to the SPDR is inhibited
while this register is shifting (a write attempt sets DCOL) or when the SPIF bit is set without reading SPSR.
Data collision never affects the receiving and transmitting data in SPDR.
A write or read of the SPDR after accessing the SPSR with SPIF set will clear the SPIF and DCOL bits.
The ability to access the SPDR is inhibited when a transmission is taking place. It is important to read the
discussion defining the DCOL and SPIF bits to understand the limits on using the SPDR.
When SSPI is not used (SPE = 0), the SPDR can be used as a general-purpose data storage register.
8.7 Port Function
The SSPI shares I/O pins with PC0–PC2. When SPE is set, PC0 becomes SDI input, PC1 becomes SDO
output and PC2 becomes SCK. The direction of SCK depends on the MSTR bit. Setting DDRC bits 0–2
does not change the data direction of the pin to output, but instead changes the source of data when
PC0–PC2 is read. If DDRCx = 1, port C bit x data latch is read and if DDRCx = 0, PORTCx pin level is
read by the CPU.
When SPE is clear, SSPI is disconnected from the I/O pins and PC0–PC2 are used as general-purpose
I/O pins. See
Freescale Semiconductor
A read during transmission causes DCOL to be set.
A write during transmission causes DCOL to be set.
6.4 Port
Address:
Reset:
Read:
Write:
C.
$000C
MSB
Bit 7
Figure 8-6. Serial Peripheral Data Register (SPDR)
MC68HC05L16 • MC68HC705L16 Data Sheet, Rev. 4.1
BIT 6
6
BIT 5
5
Unaffected by Reset
BIT 4
4
BIT 3
3
BIT 2
2
BIT 2
1
Bit 0
LSB
Port Function
75

Related parts for MCMC68HC05L16