参数资料
型号: ST52510F3M6
厂商: STMICROELECTRONICS
元件分类: 微控制器/微处理器
英文描述: MICROCONTROLLER, PDSO20
封装: SOP-20
文件页数: 3/136页
文件大小: 3335K
代理商: ST52510F3M6
Obsolete
Product(s)
- Obsolete
Product(s)
15.4.2 Slave Configuration.
In slave configuration, the serial clock is received
on the SCK pin from the master device.
The value of the SPR0, SPR1 and SPR2 bits is not
used for data transfer.
Procedure
– For correct data transfer, the slave device must
be in the same timing mode as the master de-
vice (CPOL and CPHA bits). See Figure 15.4.
– The SS pin must be connected to a low level sig-
nal during the complete byte transmit sequence,
if this pin is used.
– Clear the MSTR bit and set the SPE bit to assign
the pins to alternate function.
In this configuration the MOSI pin is a data input
and the MISO pin is a data output.
Transmit Sequence
The data byte is loaded into the 8-bit shift register
(from the internal bus) during a write cycle 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:
– The SPIF bit is set by hardware
– An interrupt is generated if SPIE bit is set.
During the last clock cycle the SPIF bit is set, a
copy of the data byte received in the shift register
is moved to a buffer. When the SPI_IN register is
read, the SPI peripheral returns the buffer value.
The SPIF bit is cleared by the following software
sequence:
1. An access to the SPI_STATUS_CR register
while the SPIF bit is set.
2. A read to the SPI_IN register.
Note: While the SPIF bit is set, all writes to the
SPI_OUT
register
are
inhibited
until
the
SPI_STATUS_CR 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 Section 15.4.6).
Depending on the CPHA bit, the SS pin has to be
set to write to the SPI_OUT register between each
data byte transfer to avoid a write collision (see
15.4.3 Data Transfer Format.
During an SPI transfer, data is simultaneously
transmitted (shifted out serially) and received
(shifted in serially). The serial clock is used to
synchronize data transfer during a sequence of
eight clock pulses.
The SS pin allows individual selection of a slave
device; the other slave devices that are not
selected do not interfere with SPI transfer.
Clock Phase and Clock Polarity
Four possible timing relationships may be chosen
by software, using the CPOL and CPHA bits.
The CPOL (clock polarity) bit controls the steady
state value of the clock when data isn’t being
transferred. This bit affects both master and slave
modes.
The combination between the CPOL and CPHA
(clock phase) bits select the data capture clock
edge.
Figure 15.4, shows an SPI transfer with the four
combinations of the CPHA and CPOL bits. The
diagram may be interpreted as a master or slave
timing diagram where the SCK pin, the MISO pin,
the MOSI pin are directly connected between the
master and the slave device.
The SS pin is the slave device select input and can
be driven by the master device.
The master device applies data to its MOSI pin-
clock edge before the capture clock edge.
CPHA bit is set
The second edge on the SCK pin (falling edge if
the CPOL bit is reset, rising edge if the CPOL bit is
set) is the MSBit capture strobe. Data is latched on
the occurrence of the second clock transition.
A write collision should not occur even if the SS pin
stays low during a transfer of several bytes (see
CPHA bit is reset
The first edge on the SCK pin (falling edge if CPOL
bit is set, rising edge if CPOL bit is reset) is the
MSBit capture strobe. Data is latched on the
occurrence of the first clock transition.
The SS pin must be toggled high and low between
each byte transmitted (see Figure 15.3).
In order to protect the transmission from a write
collision a low value on the SS pin of a slave device
freezes the data in its SPI_OUT register and does
not allow it to be altered. Therefore, the SS pin
must be high to write a new data byte in the
SPI_OUT without producing a write collision.
15.4.4 Write Collision Error.
相关PDF资料
PDF描述
ST52E430B/D 8-BIT, UVPROM, 20 MHz, MICROCONTROLLER, CDIP32
ST52F510F1M6 8-BIT, FLASH, 24 MHz, MICROCONTROLLER, PDSO20
ST52F510G0B6 8-BIT, FLASH, 24 MHz, MICROCONTROLLER, PDIP28
ST52F513F0M6 8-BIT, FLASH, 24 MHz, MICROCONTROLLER, PDSO20
ST52F513F1B6 8-BIT, FLASH, 24 MHz, MICROCONTROLLER, PDIP20
相关代理商/技术参数
参数描述
ST52510G2 制造商:未知厂家 制造商全称:未知厂家 功能描述:8-BIT ICU WITH 10-BIT ADC. TWO TIMERS/PWM. I2C. SPI. SCI. UP TO 8K FLASH
ST52510G3 制造商:未知厂家 制造商全称:未知厂家 功能描述:8-BIT ICU WITH 10-BIT ADC. TWO TIMERS/PWM. I2C. SPI. SCI. UP TO 8K FLASH
ST52510K2 制造商:未知厂家 制造商全称:未知厂家 功能描述:8-BIT ICU WITH 10-BIT ADC. TWO TIMERS/PWM. I2C. SPI. SCI. UP TO 8K FLASH
ST52510K3 制造商:未知厂家 制造商全称:未知厂家 功能描述:8-BIT ICU WITH 10-BIT ADC. TWO TIMERS/PWM. I2C. SPI. SCI. UP TO 8K FLASH
ST52510Y2 制造商:未知厂家 制造商全称:未知厂家 功能描述:8-BIT ICU WITH 10-BIT ADC. TWO TIMERS/PWM. I2C. SPI. SCI. UP TO 8K FLASH