SendTo: piclist@mitvma.mit.edu Hi PIC gurus, Lately (a few months now), I'm working on a project/product involving many PICes 84 or eventualy 61 (up to 64 for now, but expandable to 256 (or more?) in the future) organized in groups of four (as modules) controlled by a 'master' 16C65. The code in all 'slave' PICes is identical. Each of this 4 PIC 'modules' is powered and clocked separately and can be randomly switched (powered) on or off. The problem is that I developed the code in both 84 & 65 as they were dirrectly connected (ie. PIC84 <--> PIC65) and always repeating to myself "... it will be easy to modify the communication for more devices... " what a stupid presumption! (very bad technique...) Now, when I have more devices, I'm pulling my hair off... This PICes are connected on a I2C like bus (i.e. 1 CLK + 4 DATA lines driven by OC pins). Now, the questions: 1) How many devices can be connected to this type of bus? or is this calculation correct? Is there anything else I'm missing? - Is (input leakage) is max +- 5uA per I/O pin, as 95/96 databook says - R (pull up) is one 3K3 per line - Vih (min V input high) is 3.5 V for CMOS N = Vih / (Is * R) ==> N=212 2) Is there any way/trick to assign a unique ID to each device on power up or run time, so that each device gets always the same ID (this is neccessary!)? I think the simplest solution is to program each device with different ID, but I'd like to use max 8bit ID (bacause of the overhead in communication), so I'm limited to 256 IDs. Because the system is expandable by modules containing 4 units, I'll run out of 'unique' modules after 64. This will limit the existance of only few such systems. That is why I need a run-time assignation. Another 'trouble making' situation is that modules my be turned on/off as neccessary. I have few ideas if all the modules could be active at least for the setup time. 3) Did anybody implement a Ehternet (CSMA/CD) like (coax - single wire) communication protocol? Suggestions? 4) Any idea/suggestion how to connect and distinguish all that PICes? Thank you for your time, regards, mauricio Mauricio&arne.si http://www.arne.si