I²C full master MSSP module is available with a number of PIC MCU models.
mikroC provides I2C library which supports the master I²C mode.
Note: This library supports module on PORTB or PORTC, and will not work with
modules on other ports. Examples for PICmicros with module on other ports can
be found in your mikroC installation folder, subfolder “Examples”.
I2C_Init
I2C_Start
I2C_Repeated_Start
I2C_Is_Idle
I2C_Rd
I2C_Wr
I2C_Stop
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
18 8
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
I2C Library
Library Routines
Prototype
void I2C_Init(long clock);
Description Initializes I²C with desired clock (refer to device data sheet for correct values in
respect with Fosc). Needs to be called before using other functions of I2C Library.
Requires Library requires MSSP module on PORTB or PORTC.
Example
I2C_Init(100000);
I2C_Init