
2004 Microchip Technology Inc.
Preliminary
DS39637A-page 195
PIC18F2480/2580/4480/4580
17.3.8
OPERATION IN POWER MANAGED
MODES
In SPI Master mode, module clocks may be operating
at a different speed than when in full power mode; in
the case of the Sleep mode, all clocks are halted.
In most power managed modes, a clock is provided to
the peripherals. That clock should be from the primary
clock source, the secondary clock (Timer1 oscillator at
32.768 kHz) or the INTOSC source. See
Section 2.7
“Clock Sources and Oscillator Switching”
for
additional information.
In most cases, the speed that the master clocks SPI
data is not important; however, this should be
evaluated for each system.
If MSSP interrupts are enabled, they can wake the con-
troller from Sleep mode, or one of the Idle modes, when
the master completes sending data. If an exit from
Sleep or Idle mode is not desired, MSSP interrupts
should be disabled.
If the Sleep mode is selected, all module clocks are
halted and the transmission/reception will remain in
that state until the devices wakes. After the device
returns to Run mode, the module will resume
transmitting and receiving data.
In SPI Slave mode, the SPI Transmit/Receive Shift
register operates asynchronously to the device. This
allows the device to be placed in any power managed
mode and data to be shifted into the SPI Transmit/
Receive Shift register. When all 8 bits have been
received, the MSSP interrupt flag bit will be set and if
enabled, will wake the device.
17.3.9
EFFECTS OF A RESET
A Reset disables the MSSP module and terminates the
current transfer.
17.3.10
BUS MODE COMPATIBILITY
Table 17-1 shows the compatibility between the
standard SPI modes and the states of the CKP and
CKE control bits.
TABLE 17-1:
SPI BUS MODES
There is also a SMP bit which controls when the data is
sampled.
TABLE 17-2:
REGISTERS ASSOCIATED WITH SPI OPERATION
Standard SPI
Mode Terminology
Control Bits State
CKP
CKE
0, 0
0
1
0, 1
1, 0
0
1
0
1
1, 1
1
0
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
INTCON
PIR1
PIE1
IPR1
TRISA
TRISC
SSPBUF
SSPCON1
SSPSTAT
Legend:
Note 1:
GIE/GIEH PEIE/GIEL
PSPIF
(1)
PSPIE
(1)
PSPIP
(1)
PORTA Data Direction Register
PORTC Data Direction Register
Synchronous Serial Port Receive Buffer/Transmit Register
WCOL
SSPOV
SSPEN
SMP
CKE
D/A
—
= unimplemented, read as ‘
0
’. Shaded cells are not used by the MSSP in SPI mode.
These bits are unimplemented in PIC18F2X80 devices; always maintain these bits clear.
TMR0IE
RCIF
RCIE
RCIP
INT0IE
TXIF
TXIE
TXIP
RBIE
SSPIF
SSPIE
SSPIP
TMR0IF
CCP1IF
CCP1IE
CCP1IP
INT0IF
TMR2IF
TMR2IE
TMR2IP
RBIF
TMR1IF
TMR1IE
TMR1IP
49
52
52
52
52
52
50
50
50
ADIF
ADIE
ADIP
CKP
P
SSPM3
S
SSPM2
R/W
SSPM1
UA
SSPM0
BF