This one came back to hunt me after I left the same issue unsolved a year ago.
I have a slave microprocessor relaying commands trough a serial line.
Outputs are sent the usual way trough a shift register, but so far i am using the physical pins as inputs.
Any alternatives?