Hi,
I have multiple applications with the 16F87.
I would like to connect all these applications together with the I2C bus with 1 master (16F877) and all the slaves (16F87).
How can I address the slaves independently ?
Best regards
Hi,
I have multiple applications with the 16F87.
I would like to connect all these applications together with the I2C bus with 1 master (16F877) and all the slaves (16F87).
How can I address the slaves independently ?
Best regards
Zorglub,
based on the information you have given the answer is:
By simply assigning the slaves address in the I2CWRITE / I2CREAD command.
Please see also THIS
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
PICBasic only supports I2C Master mode for the Master PIC... you will have to write your own routines for the Slave Mode PICs.
Mel,
based on the information given one could assume he already has written the slave routines.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Well in that case addressing is the easiest part of all. Just assign some spare pins on the Slave PICs, ground some, and pull others up to V+ and they become the unique address for that PIC. That way, all your Slave PIC software remains the same, and when that PIC powers-up it determines it's own address. Thereafter, the Master just addresses the PICs as if they were standard I2C devices. Nothing could be simpler at that point.
Thank you,
Is the following another solution ? in the datasheet 16F87 :
Register SSPSR and SSPADD for chip addressing ????
Best regards
Hi!
Maybe these links will help you.
(Search with Google for more).
Microchip Application Note AN734:
Using the PICmicro SSP for Slave I2C Communication
http://www.microchip.com/stellent/id...pnote=en011798
Picbasic Pro project for Slave I2C Communication:
http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm
(See Microchip application note AN734 has errors).
Luciano
Bookmarks