I did a project where I used a PIC 16F887 and used all the ports, A,B,C, D for outputs to triac boards. Lots of wires.

Now I want to do another similar project using I2C protocol, conversing with 16 channel port expanders connected to 16 channel triac boards. I need 7 of each type to do the job.

I've never used I2C but it is the obvious choice for my project since all components except MCU will be outside, a few meters from the MCU.

So...how do I do it? I've read a bit about I2C and looked at examples on MELabs website. They all deal with EEPROM communication. I just have to write out patterns 8 or 16 bits at a time to my 7 I2C devices.

My current programming references ports A,B,C,D. How do I get that information out to my 2-wire devices. Eg, If I currrently write out $FF to energize 16 lights, how do I program this output to go down the 2 wire I2C line. (I use counters and data tables to load my peripheral ports too...not sure where or how to write these values out, eg if I'm sending a stream of data to light 16 lights individually in a row.)

Thanks in advance