PDA

View Full Version : 1 master 4 slave communication I2C protocol how to do?



Luna
- 22nd May 2005, 17:30
Hi , first of all I have to say that I start to work with pic programming 1 month ago so if my questions are too simple or stupid for you , please forgive me. I want to connect 5 pic together , 1 master and 4 slave. Slave pic receive data from sensors and when master ask they have to communicate value to it and receive order from master. I want to develop all with I2C communication protocol because every pic is few cm from other and I think it is simple to make without use of other component and using only 2 cable. I studied some example of communication between pic and device that communicate with I2C protocol. But I don’t understand how to differentiate one pic from an other , how to give an unique identification code. So when I m calling a pic the answer is only from the right pic. I don’t know if it is an hardware or software problem. I like if some one can help me to solve this problem and can show me so code example to make communication. After of all I want to know how is the right way to connect pic together. Thanks you in advance.

giovanni
- 10th June 2005, 00:15
Hi Luna and hi to everybody
I'm a newbie in programming pic and I'm in the same your situation...
Can anyone help me and Luna with this problem?
I'm using pascal language to program pic and I want to connect three pic; one of this is master and other two are slave...
I think that after the addressing problem, the other part of program are quite simply because I can indicate the address of the interested pic in I2CREAD/I2CWRITE, isn't it?
Thanks in advance...
Giovanni.

mister_e
- 10th June 2005, 02:34
I know it will not be a big help but, the Use of I2CREAD/I2CWRITE will be the one to use with the master. For all slaves, you'll have to build your own routines. HOW TO??? that's one of those apps to place on a board and play with. Tricky... a bit but not impossible.

If some here are willing to share their routine, you have luck guys!!!