st7pmc2s6 STMicroelectronics, st7pmc2s6 Datasheet - Page 131

no-image

st7pmc2s6

Manufacturer Part Number
st7pmc2s6
Description
8-bit Mcu For Automotive With Nested Interrupts, Flash, 10-bit Adc, Brushless Motor Control, 5 Timers, Spi, Linsci?
Manufacturer
STMicroelectronics
Datasheet
ST7MC1K2-Auto, ST7MC1K6-Auto, ST7MC2S4-Auto, ST7MC2S6-Auto
Note:
Note:
10.4.4
Note:
Slave mode operation
In slave mode, the serial clock is received on the SCK pin from the master device.
To operate the SPI in slave mode:
1.
The slave must have the same CPOL and CPHA settings as the master.
2.
Slave mode transmit sequence
When software writes to the SPIDR register, the data byte is loaded into the 8-bit shift
register and then shifted out serially to the MISO pin most significant bit first.
The transmit sequence begins when the slave device receives the clock signal and the most
significant bit of the data on its MOSI pin.
When data transfer is complete:
Clearing the SPIF bit is performed by the following software sequence:
1.
2.
While the SPIF bit is set, all writes to the SPIDR register are inhibited until the SPICSR
register is read.
The SPIF bit can be cleared during a second transmission; however, it must be cleared
before the second SPIF bit in order to prevent an overrun condition (see
(OVR) on page
Clock phase and clock polarity
Four possible timing relationships may be chosen by software, using the CPOL and CPHA
bits (see
The idle state of SCK must correspond to the polarity selected in the SPICSR register (by
pulling up SCK if CPOL = 1 or pulling down SCK if CPOL = 0).
The combination of the CPOL clock polarity and CPHA (clock phase) bits selects the data
capture clock edge.
Figure 58
The diagram may be interpreted as a master or slave timing diagram where the SCK pin, the
MISO pin and the MOSI pin are directly connected between the master and the slave
device.
Write to the SPICSR register to perform the following actions:
Write to the SPICR register to clear the MSTR bit and set the SPE bit to enable the SPI
I/O functions.
The SPIF bit is set by hardware.
An interrupt request is generated if SPIE bit is set and interrupt mask in the CCR
register is cleared.
An access to the SPICSR register while the SPIF bit is set
A write or a read to the SPIDR register
Figure
Select the clock polarity and clock phase by configuring the CPOL and CPHA bits
(see
Manage the SS pin as described in
Figure
held low during byte transmission and pulled up between each byte to let the slave
write in the shift register.
shows an SPI transfer with the four combinations of the CPHA and CPOL bits.
Figure
133).
58).
56. If CPHA = 1 SS must be held low continuously. If CPHA = 0 SS must be
58).
Slave select management on page 129
On-chip peripherals
Overrun condition
131/371
and

Related parts for st7pmc2s6