56 STC12C5Axx
Technical Summary
other is keeping the clock signal low or high while the device idle which named
phase
. Permuting those
states from
polarity
and
phase
, there could be four modes formed, they are
SPI-MODE-0
,
SPI-MODE-1
,
SPI-MODE-2
,
SPI-MODE-3
. Many device declares that they meet SPI mechanism, but few of them are
adaptive to all four modes. The STC12C5Axx is a device flexible to be configured to communicate to
another device with
MODE-0
,
MODE-1
,
MODE-2
or
MODE-3
SPI, and play part of
Master
and
Slave
.
There is a SFR named SPICTL designed to configure the SPI behavior of the device.
SFR:
SPCTL (SPI Control register)
Read/Write
Address:
0X85H
Default: 0000-0000
Bit
7
6
5
4
3
2
1
0
Name
SSIG SPEN DORD
MSTR
CPOL
CPHA SPR1
SPR0
SSIG
:= used to determine if Ignore the pin SS
0
:= (default)
Reserve the function of pin SS
1
:=
Ignore the SS pin function
SPEN
:= Enable the SPI
0
:= (default)
Disable the SPI function. All related pins play as general-purposed I/O ports.
1
:=
Enable the SPI function.
DORD
:= Data Order
0
:= (default)
Transmit/Receive the MSB of the data byte first.
1
:=
Transmit/Receive the LSB of the data byte first.
MSTR
:= Set to Master mode
0
:= (default)
Set the SPI to play as
Slave
part.
1
:=
Set the SPI to play as
Master
part.
CPOL
:= Clock Polarity
0
:= (default)
Set the SPCLK as LOW while the communication is kept idle. That implies the leading
edge of the clock is the rising edge, and the trailing edge is the falling
edge.
http://www.DataSheet4U.net/
datasheet pdf - http://www.DataSheet4U.net/