MC16Z3BCAG16 Freescale Semiconductor, MC16Z3BCAG16 Datasheet - Page 252

no-image

MC16Z3BCAG16

Manufacturer Part Number
MC16Z3BCAG16
Description
IC MCU 16BIT HI SPEED 144-LQFP
Manufacturer
Freescale Semiconductor
Series
HC16r
Datasheet

Specifications of MC16Z3BCAG16

Core Processor
CPU16
Core Size
16-Bit
Speed
16MHz
Connectivity
EBI/EMI, SCI, SPI
Peripherals
POR, PWM, WDT
Number Of I /o
16
Program Memory Size
8KB (8K x 8)
Program Memory Type
Mask ROM
Ram Size
4K x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
External
Operating Temperature
-40°C ~ 85°C
Package / Case
144-LQFP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MC16Z3BCAG16
Manufacturer:
Freescale Semiconductor
Quantity:
10 000
10.3.8 Write Collision
10.3.9 Mode Fault
10-12
A write collision occurs if an attempt is made to write the SPDR while a transfer is in
progress. Since the SPDR is not double buffered in the transmit direction, a successful
write to SPDR would cause data to be written directly into the SPI shift register. Be-
cause this would corrupt any transfer in progress, a write collision error is generated
instead. The transfer continues undisturbed, the data that caused the error is not writ-
ten to the shifter, and the WCOL bit in SPSR is set. No SPI interrupt is generated.
A write collision is normally a slave error because a slave has no control over when a
master initiates a transfer. Since a master is in control of the transfer, software can
avoid a write collision error generated by the master. The SPI logic can, however, de-
tect a write collision in a master as well as in a slave.
What constitutes a transfer in progress depends on the SPI configuration. For a mas-
ter, a transfer starts when data is written to the SPDR and ends when SPIF is set. For
a slave, the beginning and ending points of a transfer depend on the value of CPHA.
When CPHA = 0, the transfer begins when SS is asserted and ends when it is negated.
When CPHA = 1, a transfer begins at the edge of the first SCK cycle and ends when
SPIF is set. Refer to
mation on transfer periods and on avoiding write collision errors.
When a write collision occurs, the WCOL bit in the SPSR is set. To clear WCOL, read
the SPSR while WCOL is set, and then either read the SPDR (either before or after
SPIF is set) or write the SPDR after SPIF is set. (Writing the SPDR before SPIF is set
results in a second write collision error.) This process clears SPIF as well as WCOL.
When the SPI system is configured as a master and the SS input line is asserted, a
mode fault error occurs, and the MODF bit in the SPSR is set. Only an SPI master can
experience a mode fault error, caused when a second SPI device becomes a master
and selects this device as if it were a slave.
To avoid latchup caused by contention between two pin drivers, the MCU does the fol-
lowing when it detects a mode fault error:
After correcting the problems that led to the mode fault, clear MODF by reading the
SPSR while MODF is set and then writing to the SPCR. Control bits SPE and MSTR
may be restored to their original set state during this clearing sequence or after the
MODF bit has been cleared. Hardware does not allow the user to set the SPE and
MSTR bits while MODF is a logic one except during the proper clearing sequence.
1. Forces the MSTR control bit to zero to reconfigure the SPI as a slave.
2. Forces the SPE control bit to zero to disable the SPI system.
3. Sets the MODF status flag and generates an SPI interrupt if SPIE = 1.
4. Clears the appropriate bits in the MDDR to configure all SPI pins except the SS
pin as inputs.
MULTICHANNEL COMMUNICATION INTERFACE
Freescale Semiconductor, Inc.
10.3.4 SPI Clock Phase and Polarity Controls
For More Information On This Product,
Go to: www.freescale.com
M68HC16 Z SERIES
USER’S MANUAL
for more infor-

Related parts for MC16Z3BCAG16