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.

PIC 16F877A I2C micro c coding

Status
Not open for further replies.
Dear friends,
I need the program in micro c.The PIc 16F877A I2C please help me friends.....

mikroC comes with i2c examples.
What do you want to achieve, with what device you want to communicate using i2c, can you post your code here in order for us to try to help you?

here is the simple i2c code written in mikroC
Code:
void main(){
  Delay_ms(200); 
  I2C_Init(100000); //"fast" i2c initialisation

  I2C_Start(); 
  I2C_Wr(0xAA); //0xAA is the "write" address of the slave
  I2C_Wr(7); // send to address 7
  I2C_Wr(123); // send value 123
  I2C_Stop(); 
}

there is a sample i2c example here where mikroC is "master" and slave is written using picc
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top