English
Language : 

PIC18LF24K Datasheet, PDF (331/594 Pages) –
PIC18(L)F26/45/46K40
FIGURE 26-2:
SPI MASTER AND MULTIPLE SLAVE CONNECTION
SPI Master
SCK
SDO
SDI
General I/O
General I/O
General I/O
SCK
SDI
SDO
SS
SPI Slave
#1
SCK
SDI
SDO
SS
SPI Slave
#2
SCK
SDI
SDO
SS
SPI Slave
#3
26.3 SPI Mode Registers
The MSSP module has five registers for SPI mode
operation. These are:
• MSSP STATUS register (SSPxSTAT)
• MSSP Control register 1 (SSPxCON1)
• MSSP Control register 3 (SSPxCON3)
• MSSP Data Buffer register (SSPxBUF)
• MSSP Address register (SSPxADD)
• MSSP Shift register (SSPSR)
(Not directly accessible)
SSPxCON1 and SSPxSTAT are the control and
STATUS registers in SPI mode operation. The
SSPxCON1 register is readable and writable. The
lower six bits of the SSPxSTAT are read-only. The
upper two bits of the SSPxSTAT are read/write.
In one SPI master mode, SSPxADD can be loaded
with a value used in the Baud Rate Generator. More
information on the Baud Rate Generator is available in
Section 26.11 “Baud Rate Generator”.
SSPSR is the shift register used for shifting data in and
out. SSPxBUF provides indirect access to the SSPSR
register. SSPxBUF is the buffer register to which data
bytes are written, and from which data bytes are read.
In receive operations, SSPSR and SSPxBUF together
create a buffered receiver. When SSPSR receives a
complete byte, it is transferred to SSPxBUF and the
SSPxIF interrupt is set.
During transmission, the SSPxBUF is not buffered. A
write to SSPxBUF will write to both SSPxBUF and
SSPSR.
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 331