Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 6: Serial Communication Modules
Fig. 6-31 Baud Rate Generator
Useful notes ...
When the microcontroller communicates with peripheral components, it may happen that data transfer fails for some
reason. In that case, it is recommended to check the status of some bits which can clarify the problem. In practice, the
state of these bits is checked by executing a short subroutine after each byte transmission and reception (just in case).
WCOL (SPCON,7) - If you try to write a new data to the SSPBUF register while another data transmit/receive is in
progress, the WCOL bit will be set and the contents of the SSPBUF register remains unchanged. Write does not occur.
After this, the WCOL bit must be cleared in software.
BF (SSPSTAT,0) - In transmit mode, this bit is set when the CPU writes to the SSPBUF register and remains set until the
byte in serial format is shifted from the SSPSR register. In receive mode, this bit is set when data or address is loaded to
the SSPBUF register. It is cleared when the SSPBUF register is read.
SSPOV (SSPCON,6) - In receive mode, this bit is set when a new byte is received by the SSPSR register via serial
communication, whereas the previously received data has not been read from the SSPBUF register yet.
SDA and SCL Pins - When SPP module is enabled, these pins turns into Open Drain outputs. It means that these pins must
be connected to the resistors which, at the other end, are connected to positive power supply.
Fig. 6-32 Open Drain Output Resistors
http://www.mikroe.com/en/books/picmcubook/ch6/ (26 of 27)5/3/2009 11:34:00 AM