English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (396/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
17.2.3.3 Slave Mode Initialization
The following steps are used to set up the SPI module
for the Slave mode of operation:
1. If interrupts are used, disable the SPI interrupts
in the respective IEC0/1 register.
2. Stop and reset the SPI module by clearing the
ON bit.
3. Clear the receive buffer.
1. If using interrupts, the following additional steps
are performed:
• Clear the SPIx interrupt flags/events in the
respective IFS0/1 register.
• Set the SPIx interrupt enable bits in the
respective IEC0/1 register.
• Write the SPIx interrupt priority and subprior-
ity bits in the respective IPC5/7 register.
2. Clear the SPIROV bit (SPIxSTAT<6>).
3. Write the selected configuration settings to the
SPIxCON
register
with
MSTEN
(<SPIxCON<5>) = 0.
4. Enable SPI operation by setting the ON bit
(SPIxCON<15>).
5. Transmission (and reception) will start as soon
as the master provides the serial clock.
Note 1: The user must turn off the SPI device
prior to changing the CKE or CKP bits.
Otherwise, the behavior of the device is
not ensured.
2: The SPI device must be turned off prior to
changing the mode from Master to Slave.
3: The SPIxSR register cannot be written
into directly by the user. All writes to the
SPIxSR register are performed through
the SPIxBUF register.
DS61143E-page 394
Preliminary
© 2008 Microchip Technology Inc.