Datasheets»Microchip Technology»PIC16F87XATI/SP Datasheet

PIC16F87XATI/SP Datasheet - Page 95

Download or read online Microchip Technology PIC16F87XATI/SP 28/40/44-Pin Enhanced Flash Microcontrollers pdf datasheet.



Page
95 of 234
prevnext
9.4.6
MASTER MODE
Master mode is enabled by setting and clearing the
appropriate SSPM bits in SSPCON and by setting the
SSPEN bit. In Master mode, the SCL and SDA lines
are manipulated by the MSSP hardware.
Master mode of operation is supported by interrupt
generation on the detection of the Start and Stop con-
ditions. The Stop (P) and Start (S) bits are cleared from
a Reset or when the MSSP module is disabled. Control
2
of the I
C bus may be taken when the P bit is set or the
bus is Idle, with both the S and P bits clear.
In Firmware Controlled Master mode, user code
2
conducts all I
C bus operations based on Start and
Stop bit conditions.
Once Master mode is enabled, the user has six
options.
1.
Assert a Start condition on SDA and SCL.
2.
Assert a Repeated Start condition on SDA and
SCL.
3.
Write to the SSPBUF
register,
transmission of data/address.
2
4.
Configure the I
C port to receive data.
5.
Generate an Acknowledge condition at the end
of a received byte of data.
6.
Generate a Stop condition on SDA and SCL.
FIGURE 9-16:
MSSP BLOCK DIAGRAM (I
SDA
SDA In
SCL
SCL In
Bus Collision
 2001-2013 Microchip Technology Inc.
Note:
The MSSP module, when configured in
2
I
C Master mode, does not allow queueing
of events. For instance, the user is not
allowed to initiate a Start condition and
immediately write the SSPBUF register to
initiate transmission before the Start condi-
tion is complete. In this case, the SSPBUF
will not be written to and the WCOL bit will
be set, indicating that a write to the
SSPBUF did not occur.
The following events will cause SSP Interrupt Flag bit,
SSPIF, to be set (SSP interrupt if enabled):
• Start condition
• Stop condition
• Data transfer byte transmitted/received
• Acknowledge transmit
• Repeated Start
initiating
2
C MASTER MODE)
Internal
Data Bus
Read
Write
SSPBUF
Shift
Clock
SSPSR
MSb
LSb
Start bit, Stop bit,
Acknowledge
Generate
Start bit Detect
Stop bit Detect
Write Collision Detect
Set/Reset, S, P, WCOL (SSPSTAT)
Clock Arbitration
Set SSPIF, BCLIF
State Counter for
Reset ACKSTAT, PEN (SSPCON2)
end of XMIT/RCV
PIC16F87XA
SSPM3:SSPM0
SSPADD<6:0>
Baud
Rate
Generator
DS39582C-page 95

Comments to this Datasheet