Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C slave code for Hitech

Status
Not open for further replies.

212853

Newbie level 6
Joined
Jan 6, 2004
Messages
13
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
119
i2c slave code

Does anybody know where I can find code to impliment I2C as a slave in C? I want 2 pic to communicate with each other.
 

an734 in hitech

Which PIC do you plan to use as your slave?

I would recommend one with a MSSP port (hardware I2C) otherwise a I2C slave is very hard to implement.

Another point is that the slave pulls SCL low while it is processing your request so your master code must wait until SCL is released from the slave before transmitting the next command or databyte.

This is very important and must be implemented in your master code ...

If you just need some simple communication use an asynchronous serial connection which is very easy to implement.

best regards
 

master code hitech



HH

NeuralC
 

i2c slave without ssp mssp

My master will be a 16F877 and the slave would be a 16F870.
 

i2c code hitech

Look here:
**broken link removed**

AN735 Using the PICmicro MSSP Module for I2C Communications 8/16/00
AN734 Using the PICmicro SSP for Slave I2C Communication 8/7/00

I used a more or less 1:1 translation of AN734 into C for my slave code.

Just a short note:
I would not use the 16F870 as I2C slave because it has no hardware I2C (MSSP or SSP) use 16F876 or 16F87 or 16F88 instead ...

best regards
 

16f876 i2c slave

Have a look also here:


HH
NeuralC
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top