Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C tutorial

Status
Not open for further replies.
Hi All,

During my studying of the I2C I now have some questions. When I write an adress to a device e.g. PCF8583 I write (mikroC-code):

Code:
Soft_I2C_Write(0xA0);          // Address PCF8583

But what if I have 4 PCF8583's coupled to the PIC with I2C, what to write for communicating with one at a time?

Also when I write

Code:
Soft_I2C_Write(0);             // Write 0 to cents word
Soft_I2C_Write(0);             // Write 0 to seconds word
Soft_I2C_Write(0x30);          // Write 0x30 to minutes word
Soft_I2C_Write(0x11);          // Write 0x11 to hours word
Soft_I2C_Write(0x30);          // Write 0x24 to year/date word

Is the device programmed to have the data in that order and then sending data for the PIC?
 
With I2C each device is given it's own address, many IC's have configurable addresses, using pins you either ground or connect to 5V - if the devices address isn't configurable than you can only have one such device per bus.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top