HI2CWaitMSSP

Syntax:

    HI2CWaitMSSP

Command Availability:

Only available for microcontrollers with the hardware I2C or TWI module.

Explanation:

The methods sets the global byte variable HI2CWaitMSSPTimeout to 255 ( or True ) if the MSSP module has timeout during operations.

HI2CWaitMSSPTimeout can tested for the status of the I2C bus.

Note:

This command is also available on microcontrollers with a second hardware I2C port.

    HI2C2WaitMSSP

Example:

    HI2CStart
    HI2CWaitMSSP          ' <<< the HI2CWaitMSSP instruction

    if HI2CWaitMSSPTimeout <> True then
        HI2CSend ( deviceID )
    else
        HSerPrint "Bus timeout!"
    end if

Key line: HI2CWaitMSSP — waits for the hardware MSSP module to become ready and sets HI2CWaitMSSPTimeout to true if it timed out instead, so the following code can check the bus status before sending.

See Also:

Supported in <HI2C.H>