Hbusin - Hbusout Declares.
Declare HSDA_Pin Port.Pin Declares the port and pin used for the MSSP1 module’s data line (SDA). If the declare is not used in the program, it may not always default to the standard pin configuration, so make sure they are in the BASIC listing.
Declare HSCL_Pin Port.Pin Declares the port and pin used for the MSSP1 module’s clock line (SCL). If the declare is not used in the program, it may not always default to the standard pin configuration, so make sure they are in the BASIC listing.
Declare Hbus_Bitrate Constant 100, 400, 1000 etc. The standard speed for the I2C bus is 100KHz. Some devices use a higher bus speed of 400KHz. The above Declare allows the I2C bus speed to be increased or decreased. Use this Declare with caution, as too high a bit rate may exceed the device's specs, which will result in intermittent transactions, or in some cases, no transactions at all. The datasheet for the device used will inform you of its bus speed. The default bit rate is the standard 100KHz.
Notes.
Because the I2C protocol calls for an open-collector interface, pull-up resistors are required on both the SDA and SCL lines. Values of 1KΩ to 4.7KΩ will suffice.
