oh ok i see now. Simple then ...
Have it send out pulses. 20 Pulses for RA0 etx
RA0 = send 10 pulses
RA1 = send 20 pulses
RA2 = send 30 pulses
RA3 = send 40 pulses
RA4 = send 50 pulses
Then have it check on the other side like count every pulse
Count must start on a high and increase every other high.
RB0 = must count 10 pulses
RB1 = must count 20 pulses
RB2 = must count 30 pulses
RB3 = must count 40 pulses
RB4 = must count 50 pulses
Or you can do like "be80be" said
send out numbers. like number 4 in binary is 0100 so you can have it have a clock line so you can determine when new data is being clocked in.
So to send a 4: (0100)
---------------------------
Set Clock pin high , Data pin low(0), set clock pin low
Set Clock pin high , Data pin high(1), set clock pin low
Set Clock pin high , Data pin low(0), set clock pin low
Set Clock pin high , Data pin low(0), set clock pin low
That will send a 0100 aka 4.
On the recieve side you would have to shift in the bits 1 by 1 into a byte(nybble) on every clock high