ST92141 STMicroelectronics, ST92141 Datasheet - Page 145

no-image

ST92141

Manufacturer Part Number
ST92141
Description
8/16-bit Mcu For 3-phase Ac Motor Control
Manufacturer
STMicroelectronics
Datasheet
SERIAL PERIPHERAL INTERFACE (Cont’d)
7.5.6 Register Description
DATA REGISTER (SPDR)
R240 - Read/Write
Register Page: 7
Reset Value: 0000 0000 (00h)
The DR register is used to transmit and receive
data on the serial bus. In the master device only a
write to this register will initiate transmission/re-
ception of another byte.
Notes: During the last clock cycle the SPIF bit is
set, a copy of the received data byte in the shift
register is moved to a buffer. When the user reads
the serial peripheral data register, the buffer is ac-
tually being read.
Warning: A write to the DR register places data di-
rectly into the shift register for transmission.
A read to the DR register returns the value located
in the buffer and not the content of the shift regis-
ter (see
CONTROL REGISTER (SPCR)
R241 - Read/Write
Register Page: 7
Reset Value: 0000 0000 (00h)
Bit 7 = SPIE Serial peripheral interrupt enable.
This bit is set and cleared by software.
0: Interrupt is inhibited
1: An SPI interrupt is generated whenever either
Bit 6 = SPOE Serial peripheral output enable.
This bit is set and cleared by software. It is also
cleared by hardware when, in master mode, SS=0
(see
0: SPI alternate functions disabled (MISO, MOSI
1: SPI alternate functions enabled (MISO, MOSI
SPIE
D7
SPIF or MODF are set in the SR register while
the other flag is 0.
and SCK can only work as input)
and SCK can work as input or output depending
on the value of MSTR)
7
7
Section 7.5.4.5 Master Mode
SPOE SPIS MSTR
D6
Figure
D5
73).
D4
CPOL
D3
CPHA
D2
Fault).
SPR1
D1
ST92141 - SERIAL PERIPHERAL INTERFACE (SPI)
D0
SPR0
0
0
Note: To use the MISO, MOSI and SCK alternate
functions (input or output), the corresponding I/O
port must be programmed as alternate function
output.
Bit 5 = SPIS Interrupt Selection.
This bit is set and cleared by software.
0: Interrupt source is external interrupt
1: Interrupt source is SPI
Bit 4 = MSTR Master.
This bit is set and cleared by software. It is also
cleared by hardware when, in master mode, SS=0
(see
0: Slave mode is selected
1: Master mode is selected, the function of the
Bit 3 = CPOL Clock polarity.
This bit is set and cleared by software. This bit de-
termines the steady state of the serial Clock. The
CPOL bit affects both the master and slave
modes.
0: The steady state is a low value at the SCK pin.
1: The steady state is a high value at the SCK pin.
Bit 2 = CPHA Clock phase.
This bit is set and cleared by software.
0: The first clock transition is the first data capture
1: The second clock transition is the first capture
Bit 1:0 = SPR[1:0] Serial peripheral rate.
These bits are set and cleared by software. They
select one of four baud rates to be used as the se-
rial clock when the device is a master.
These 2 bits have no effect in slave mode.
Table 28. Serial Peripheral Baud Rate
SCK pin changes from an input to an output and
the functions of the MISO and MOSI pins are re-
versed.
edge.
edge.
INTCLK Clock Divide
Section 7.5.4.5 Master Mode
16
32
2
4
SPR1
0
0
1
1
Fault).
SPR0
145/179
0
1
0
1
9

Related parts for ST92141