Software I2C Library - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers

Software I2C Library

mikroC provides routines which implement software I²C. These routines are hard-
ware independent and can be used with any MCU. Software I2C enables you to
use MCU as Master in I2C communication. Multi-master mode is not supported.
Note: This library implements time-based activities, so interrupts need to be dis-
abled when using Soft I²C.
Library Routines
Soft_I2C_Config
Soft_I2C_Start
Soft_I2C_Read
Soft_I2C_Write
Soft_I2C_Stop
Soft_I2C_Config
Prototype
void Soft_I2C_Config(char *port, const char SDI, const char SD0,
const char SCK);
Description
Configures software I²C. Parameter
pins are located. Parameters
the same pin.
Soft_I2C_Config
Library.
Example
Soft_I2C_Config(PORTB, 1, 2);
page
254
specifies port of MCU on which
port
and
need to be in range 0–7 and cannot point at
SCL
SDA
needs to be called before using other functions from Soft I2C
MikroElektronika: Development tools - Books - Compilers
mikroC
making it simple...
and
SDA
SCL

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents