English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (392/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
17.2 Master and Slave Modes
The PIC32MX3XX/4XX SPI module operates in normal
Master or Slave modes and offers the following addi-
tional modes:
• Framed Master
• Framed Slave
• 8, 16, 32-bit Data Width Transfers
• Slave Select (Slave mode only)
Below is a typical system Master – Slave connection
diagram.
17.2.1 8, 16, AND 32-BIT OPERATION
The PIC32MX3XX/4XX SPI module allows three types
of data widths when transmitting and receiving data
over an SPI bus. The selection of data width deter-
mines the minimum length of SPI data.
Two control bits, MODE32 and MODE16
(SPIxCON<11:10>), define the mode of operation. To
change the mode of operation on the fly, the SPI mod-
ule must be idle, i.e., not performing any transactions.
If the SPI module is switched off (SPIxCON<15> = 0),
the new mode will be available when the module is
again switched on.
The number of clock pulses at the SCKx pin are depen-
dent on the selected mode of operation. For 8-bit mode,
8 clocks; for 16-bit mode, 16 clocks; and for 32-bit mode,
32 clocks are required.
FIGURE 17-2:
SPI MASTER/SLAVE CONNECTION
PIC32MX3XX/4XX
[SPI Master]
Serial Receive Buffer
(SPIxRXB)(2)
SDOx
PROCESSOR 2
[SPI Slave]
SDIx
Serial Receive Buffer
(SPIxRXB)
Shift Register
(SPIxSR)
MSB
LSB
SDIx
SDOx
Shift Register
(SPIxSR)
MSB
LSB
Serial Transmit Buffer
(SPIxTXB)(2)
Serial Transmit Buffer
(SPIxTXB)
SPI Buffer
(SPIxBUF)
Serial Clock
SCKx
GPIO/SSx .
MSTEN (SPIxCON<5>) = 1
SCKx
SSx(1)
SPI Buffer
(SPIxBUF)
SSEN (SPIxCON<7>) = 1 and
MSTEN (SPIxCON<5>) = 0
Note 1: Using the SSx pin in Slave mode of operation is optional.
2: User must write transmit data to SPIxBUF and read received data from SPIxBUF. The SPIxTXB and SPIxRXB
registers are memory mapped to SPIxBUF.
DS61143E-page 390
Preliminary
© 2008 Microchip Technology Inc.