I2CStop

Syntax:

    I2CStop

Command Availability:

Available on all microcontrollers except 12 bit instruction microcontrollers (10F, 12F5xx, 16F5xx chips)

Explanation:

When in Master mode, this command will send an I2C stop condition, and re-enable interrupts if I2CStart disabled them. In Slave mode, it will re-enable interrupts.

I2CStop should be called at the end of every I2C transmission.

Example:

    'Writes a single byte to an I2C EEPROM at device address 0xA0, memory address 0x00
    I2CStart
    I2CSend 0xA0
    I2CSend 0x00
    I2CSend 0x55
    I2CStop          ' <<< the I2CStop instruction

Key line: I2CStop — sends the stop condition that ends the transmission, and re-enables interrupts if I2CStart had disabled them.

See Also:

  • I2C Overview — category overview
  • I2CStart — the matching command that begins the transmission
  • I2CSend — sending bytes between I2CStart and I2CStop
  • I2CReceive — receiving bytes between I2CStart and I2CStop

Supported in <I2C.H>