Greetings all,

I am embarking on a path toward making a device that is used to count events with 10 12F675's acting as slaves to a single 18F device as master. The 18F device will also be sending information to a computer via USB as a HID class device.

I have done some preliminary reading to find what resources I can that use I2C for multiple devices (such as 10 at once), and I haven't found anything that looked easy or complete.

I am going to try to build my program from what I could find by a guy named Roberts. His website seems to lay it all out, but one can never be sure if it will be sufficient.

My plan is to have each 12F675 running the I2C routines continuously, and disrupt this activity to count events based on an interrupt. The event counting will store values that are then communicated during the I2C routines to the master. The events are of multiple types, so the event counting has to be able to differentiate between types of events to count properly.

The 18F master will go through a cycle of polling the individual 12F675 slaves for their currently counted values. These values will then be sent via USB to the attached computer. If the computer is not attached, the counts will be updated in memory on the 18F and when the computer is reattached the current values will be communicated.

My purpose in starting this thread is to make available what I learn about I2C in the process, as I could easily see many hobbyist and commercial applications using such a framework.
This particular project has application as a commercial product, and I fully intend to pursue this aspect, as I said though, I can also see many hobbyist applications as well.

I would like to pose some questions that I don't know the answers to yet.

First, has anyone had experience using 10+ devices on an I2C bus at the same time and had success? Were there difficulties encountered by virtue of having so many slaves?

I haven't used interrupts before. I am aware that there are hardware interrupts and PBP's own method, and that latency of currently executing code affects the PBP interrupt handling. I would like to use the PBP software method if possible. Does anyone know whether or not the I2C routines could cause latency greater than a few milliseconds? I need to be able to count my events on the 12F675's and catch them within about five ms to get accurate counts. If the PBP I2C routines are going to cause too much latency with the PBP interrupt method, I may have to do an assembly interrupt handler (and I haven't taken the assembly dive yet, so this is discouraging at the moment). I'm aware that the I2C rate is in the 10-100khz range, but if there are any individual events that take a long time, I could still lose out.

I haven't created a USB pic device yet. Any thoughts? This is one of the reasons I'm excited about this project. I understand that most pic devices are identified as HID class because it is easy to implement. I think it will be fun to have the ability to make USB devices in the future.
I've seen enough USB pic projects featured on a number of blogs to think that I will be able to figure this part out.

I would love it if you would like to share your experiences, and warn me ahead of time about possible time-sinks that I can avoid. I would always prefer to do things the smart way.

Thanks, Mike