I need to add multiple serial ports to a project. I plan to use four PIC12F1840s with hardware EUSARTs and internal oscillators running independently and communicating with the main processor (ATmega1284P) via I2C. The PICs will be pre-programmed SMD and the boards will be assembled in China. There will also be a PIC12F1822 handling a half-duplex RS485 network and communicating via I2C and a MAX3421E USB Host using SPI to the main processor. I would like the four RS232 PICs to share an INT line and the main processor will poll them for data when the INT is activated but could just let the main processor poll them periodically. In my application, data is sporadic and rather sparse with 19200 being the maximum rate (at this time) but the PCB will be an Arduino compatible shield so it may be put to more demanding uses.

My questions:

1. The only functions will be serial I/O and I2C. Will On Interrupt be adequate to service the serial port and/or the I2C bus or will I need to use DT's ASM interrupts? If the latter, can you point me to example code I can adapt?

2. I would like to find a way for the four serial port PICs to self-identify their I2C address. If I use an INT line, each has only one free pin (Pin 4, input only). If I don't use an INT line there is another free pin and I can use those for a 2-bit address. Can anyone suggest a way to do this with one input-only pin? One way would be to use two different PIC models, then 1-bit is sufficient but I need PICs with similar capabilities - hardware UART & hardware I2C.

3. What are the flaws in my hare-brained scheme?