Information
PIC18F2455/2550/4455/4550
DS80220J-page 10 © 2008 Microchip Technology Inc.
26. Module: MSSP
With MSSP in SPI Master mode, FOSC/64 or
Timer2/2 clock rate and CKE = 0, a write collision
may occur if SSPBUF is loaded immediately after
the transfer is complete. A delay may be required
after the MSSP Interrupt Flag bit, SSPIF, is set or
the Buffer Full bit, BF, is set, and before writing
SSPBUF. If the delay is insufficiently short, a write
collision may occur as indicated by the WCOL bit
being set.
Work around
Add a software delay of one SCK period after
detecting the completed transfer and prior to
updating the SSPBUF contents. Verify the WCOL
bit is clear after writing SSPBUF. If the WCOL is
set, clear the bit in software and rewrite the
SSPBUF register.
Date Codes that pertain to this issue:
All engineering and production devices.
27. Module: MSSP
In an I
2
C system with multiple slave nodes, an
unaddressed slave may respond to bus activity
when data on the bus matches its address. The
first occurrence will set the BF bit. The second
occurrence will set the BF and the SSPOV bits. In
both situations, the SSPIF bit is not set and an
interrupt will not occur. The device will vector to the
Interrupt Service Routine only if the interrupt is
enabled and an address match occurs.
Work around
The I
2
C slave must clear the SSPOV bit after each
I
2
C event to maintain normal operation.
Date Codes that pertain to this issue:
All engineering and production devices.
28. Module: MSSP (SPI Mode)
When the SPI is using Timer2/2 as the clock
source, a shorter than expected SCK pulse may
occur on the first bit of the transmitted/received
data (Figure 1).
FIGURE 1: SCK PULSE VARIATION
USING TIMER2/2
Work around
To avoid producing the short pulse, turn off Timer2
and clear the TMR2 register, load the SSPBUF
with the data to transmit and then turn Timer2 back
on. Refer to Example 6 for sample code.
EXAMPLE 6: AVOIDING THE INITIAL
SHORT SCK PULSE
Date Codes that pertain to this issue:
All engineering and production devices.
SDO
SCK
Write SSPBUF
bit 7 =
1
bit 6 =
0
bit 5 =
1
. . . .
LOOP BTFSSPIR1, SSPIF ;Data received?
;(Xmit complete?)
BRA LOOP ;No
BCF PIR1, SSPIF ;Clear flag
MOVFSSPBUF, W ;W = SSPBUF
MOVWFRXDATA ;Save in user RAM
MOVFTXDATA, W ;W = TXDATA
BCF T2CON, TMR2ON;Timer2 off
CLRFTMR2 ;Clear Timer2
MOVWFSSPBUF ;Xmit New data