English
Language : 

PIC18F2220_07 Datasheet, PDF (165/386 Pages) Microchip Technology – 28/40/44-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
PIC18F2220/2320/4220/4320
17.3.8 MASTER IN POWER-MANAGED
MODES
In Master mode, module clocks may be operating at a
different speed than when in full power mode, or in the
case of the power-managed Sleep mode, all clocks are
halted.
In most power-managed modes, a clock is provided
to the peripherals and is derived from the primary
clock source, the secondary clock (Timer1 oscillator
at 32.768 kHz) or the internal oscillator block (one of
eight frequencies between 31 kHz and 8 MHz). 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 a power-managed mode when the master
completes sending data. If an exit from a power-
managed 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 pause until
the device wakes from the power-managed mode.
After the device returns to full power mode, the module
will resume transmitting and receiving data.
17.3.8.1 Slave in Power-Managed Modes
In 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 MSSP interrupts are
enabled, will wake the device from a power-managed
mode.
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
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 17-2: REGISTERS ASSOCIATED WITH SPI OPERATION
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
INTCON
PIR1
PIE1
IPR1
GIE/GIEH
PSPIF(1)
PSPIE(1)
PSPIP(1)
PEIE/
GIEL
ADIF
ADIE
ADIP
TMR0IE INT0IE
RCIF
RCIE
RCIP
TXIF
TXIE
TXIP
RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u
SSPIF
SSPIE
SSPIP
CCP1IF
CCP1IE
CCP1IP
TMR2IF
TMR2IE
TMR2IP
TMR1IF
TMR1IE
TMR1IP
0000 0000 0000 0000
0000 0000 0000 0000
1111 1111 1111 1111
TRISC
PORTC Data Direction Register
1111 1111 1111 1111
SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register
xxxx xxxx uuuu uuuu
SSPCON1 WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 0000 0000
TRISA
TRISA7(1) TRISA6(1) PORTA Data Direction Register
--11 1111 --11 1111
SSPSTAT SMP
CKE
D/A
P
S
R/W
UA
BF 0000 0000 0000 0000
Legend: x = unknown, u = unchanged, - = unimplemented, read as ‘0’. Shaded cells are not used by the MSSP in SPI mode.
Note 1: The PSPIF, PSPIE and PSPIP bits are reserved on the PIC18F2X20 devices; always maintain these bits clear.
© 2007 Microchip Technology Inc.
DS39599F-page 163