In order to develop a "small" serial interface (not only arduino but also with a pic processor) maybe useful
add a "Protocol custom string" for every input/output
Ex:
input
[IA1] (means Input A(n°1) is at level 1)
[IA0] (means Input A(n°1) is at level 0)
[IB0] (means Input B(n°2) is at level 0)
...
output
[OA1] (means output A(n°1) set to level 1)
[OA0] (means output A(n°1) set to level 0)
[OB1] (means output B(n°2) set to level 1)
...
It's very simple to develop board and connections using this way.
Steve