A96G140/A96G148/A96A148 User’s manual
15. USI
169
goes to active low. The first SCKn edge causes both the master and the slave to sample the data bit
value on their MISOn and MOSIn inputs, respectively. At the second SCKn edge, the USIn shifts the
second data bit value out to the MOSIn and MISOn outputs of the master and slave, respectively. Unlike
the case of CPHAn=1, when CPHAn=0, the
slave’s SSn input must go to its inactive high level between
transfers. This is because the slave can prepare the first data bit when it detects falling edge of SSn
input.
Figure 92. USIn SPI Clock Formats when CPHAn = 1
When CPHAn = 1, the slave begins to drive its MISOn output when SSn goes active low, but the data
is not defined until the first SCKn edge. The first SCKn edge shifts the first bit of data from the shifter
onto the MOSIn output of the master and the MISOn output of the slave. The next SCKn edge causes
both the master and slave to sample the data bit value on their MISOn and MOSIn inputs, respectively.
At the third SCKn edge, the USIn shifts the second data bit value out to the MOSIn and MISOn output
of the master and slave respectively. When CPHAn=1, the slave’s SSn input i
s not required to go to its
inactive high level between transfers.
Because the SPI logic reuses the USIn resources, SPI mode of operation is similar to that of
synchronous or asynchronous operation. An SPI transfer is initiated by checking for the USIn Data
Register Empty flag (DREn=1) and then writing a byte of data to the USInDR Register.
SCKn
(CPOLn=1)
MISOn
MOSIn
SCKn
(CPOLn=0)
/SSn OUT
(MASTER)
BIT7
BIT0
/SSn IN
(SLAVE)
BIT6
BIT1
…
…
BIT2
BIT5
BIT0
BIT7
BIT1
BIT6
SAMPLE
MSB First
LSB First