PIC18F2331/2431/4331/4431
The sequence of events for 10-Bit Addressing mode is
as follows, with Steps 7-9 for slave-transmitter:
19.3.1.1
Addressing
Once the SSP module has been enabled, it waits for a
Start condition to occur. Following the Start condition,
the 8 bits are shifted into the SSPSR register. All incom-
ing bits are sampled with the rising edge of the clock
(SCL) line. The value of register SSPSR<7:1> is
compared to the value of the SSPADD register. The
address is compared on the falling edge of the eighth
clock (SCL) pulse. If the addresses match, and the BF
and SSPOV bits are clear, the following events occur:
1. Receive first (high) byte of address (SSPIF, BF
and UA bits are set).
2. Update the SSPADD register with second (low)
byte of address (clears bit, UA, and releases the
SCL line).
3. Read the SSPBUF register (clears bit, BF) and
clear flag bit, SSPIF.
4. Receive second (low) byte of address (SSPIF,
BF and UA bits are set).
a) The SSPSR register value is loaded into the
SSPBUF register.
5. Update the SSPADD register with the first (high)
byte of address. If match releases SCL line, this
will clear bit, UA.
b) The Buffer Full bit, BF, is set.
c) An ACK pulse is generated.
6. Read the SSPBUF register (clears bit, BF) and
clear flag bit, SSPIF.
d) SSP Interrupt Flag bit, SSPIF (PIR1<3>), is set
(interrupt is generated if enabled) on the falling
edge of the ninth SCL pulse.
7. Receive Repeated Start condition.
8. Receive first (high) byte of address (SSPIF and
BF bits are set).
In 10-Bit Addressing mode, two address bytes need to
be received by the slave (Figure 19-7). The five Most
Significant bits (MSbs) of the first address byte specify
if this is a 10-bit address. Bit R/W (SSPSTAT<2>) must
specify a write so the slave device will receive the
second address byte. For a 10-bit address, the first
byte would equal ‘1111 0 A9 A8 0’, where A9and
A8are the two MSbs of the address.
9. Read the SSPBUF register (clears bit, BF) and
clear flag bit, SSPIF.
TABLE 19-2: DATA TRANSFER RECEIVED BYTE ACTIONS
Status Bits as Data
Set SSPIF Bit
(SSP interrupt occurs
if enabled)
Generate ACK
Transfer is Received
SSPSR SSPBUF
Pulse
BF
SSPOV
0
1
1
0
0
0
1
1
Yes
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Note: Shaded cells show the conditions where the user software did not properly clear the overflow condition.
2010 Microchip Technology Inc.
DS39616D-page 213