English
Language : 

PIC18F1XK22 Datasheet, PDF (143/388 Pages) Microchip Technology – 20-Pin Flash Microcontrollers with nanoWatt XLP Technology
PIC18F1XK22/LF1XK22
14.2.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 all Idle modes, a clock is provided to the peripherals.
That clock could be from the primary clock source, the
secondary clock (Timer1 oscillator at 32.768 kHz) or
the INTOSC source. See Section 18.0 “Power-Man-
aged Modes” 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.
When MSSP interrupts are enabled, after the master
completes sending data, an MSSP interrupt will wake
the controller:
• from Sleep, in Slave mode
• from Idle, in Slave or Master mode
If an exit from Sleep or Idle mode is not desired, MSSP
interrupts should be disabled.
In SPI Master mode, when the Sleep mode is selected,
all module clocks are halted and the transmis-
sion/reception will remain in that state until the device
wakes. After the device returns to Run mode, the mod-
ule 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.
14.2.9 EFFECTS OF A RESET
A Reset disables the MSSP module and terminates the
current transfer.
14.2.10 BUS MODE COMPATIBILITY
Table 14-1 shows the compatibility between the
standard SPI modes and the states of the CKP and
CKE control bits.
TABLE 14-1: SPI BUS MODES
Standard SPI Mode
Terminology
Control Bits State
CKP
CKE
0, 0
0
1
0, 1
0
0
1, 0
1
1
1, 1
1
0
There is also an SMP bit which controls when the data
is sampled.
TABLE 14-2: REGISTERS ASSOCIATED WITH SPI OPERATION
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RABIE
IPR1
—
ADIP
RCIP
TXIP SSPIP
PIE1
—
ADIE
RCIE
TXIE SSPIE
PIR1
—
ADIF
RCIF
TXIF
SSPIF
TRISB
TRISB7 TRISB6 TRISB5 TRISB4
—
TRISC
TRISC7 TRISC6 TRISC5 TRISC4 TRISC3
SSPBUF SSP Receive Buffer/Transmit Register
SSPCON1 WCOL SSPOV SSPEN CKP SSPM3
SSPSTAT
SMP
CKE
D/A
P
S
Legend: Shaded cells are not used by the MSSP in SPI mode.
TMR0IF
CCP1IP
CCP1IE
CCP1IF
—
TRISC2
SSPM2
R/W
Bit 1
INT0IF
TMR2IP
TMR2IE
TMR2IF
—
TRISC1
SSPM1
UA
Bit 0
RABIF
TMR1IP
TMR1IE
TMR1IF
—
TRISC0
SSPM0
BF
Reset
Values
on page
257
260
260
260
260
260
258
258
258
 2010 Microchip Technology Inc.
Preliminary
DS41365D-page 143