Datasheet
2010-2012 Microchip Technology Inc. DS41413C-page 267
PIC12(L)F1822/PIC16(L)F1823
flag is cleared and the Baud Rate Generator is turned
off until another write to the SSP1BUF takes place,
holding SCL low and allowing SDA to float.
25.6.6.1 BF Status Flag
In Transmit mode, the BF bit of the SSP1STAT register
is set when the CPU writes to SSP1BUF and is cleared
when all eight bits are shifted out.
25.6.6.2 WCOL Status Flag
If the user writes the SSP1BUF when a transmit is
already in progress (i.e., SSP1SR is still shifting out a
data byte), the WCOL is set and the contents of the buf-
fer are unchanged (the write does not occur).
WCOL must be cleared by software before the next
transmission.
25.6.6.3 ACKSTAT Status Flag
In Transmit mode, the ACKSTAT bit of the SSP1CON2
register is cleared when the slave has sent an Acknowl-
edge (ACK
= 0) and is set when the slave does not
Acknowledge (ACK
= 1). A slave sends an Acknowl-
edge when it has recognized its address (including a
general call), or when the slave has properly received
its data.
25.6.6.4 Typical Transmit Sequence:
1. The user generates a Start condition by setting
the SEN bit of the SSP1CON2 register.
2. SSP1IF is set by hardware on completion of the
Start.
3. SSP1IF is cleared by software.
4. The MSSP1 module will wait the required start
time before any other operation takes place.
5. The user loads the SSP1BUF with the slave
address to transmit.
6. Address is shifted out the SDA pin until all eight
bits are transmitted. Transmission begins as
soon as SSP1BUF is written to.
7. The MSSP1 module shifts in the ACK
bit from
the slave device and writes its value into the
ACKSTAT bit of the SSP1CON2 register.
8. The MSSP1 module generates an interrupt at
the end of the ninth clock cycle by setting the
SSP1IF bit.
9. The user loads the SSP1BUF with eight bits of
data.
10. Data is shifted out the SDA pin until all eight bits
are transmitted.
11. The MSSP1 module shifts in the ACK
bit from
the slave device and writes its value into the
ACKSTAT bit of the SSP1CON2 register.
12. Steps 8-11 are repeated for all transmitted data
bytes.
13. The user generates a Stop or Restart condition
by setting the PEN or RSEN bits of the
SSP1CON2 register. Interrupt is generated
once the Stop/Restart condition is complete.