It all depends on what you expect it to do. Without two UARTs it would be very difficult to receive from both ports at the same time. If it is basically one or the other, that makes the job a lot easier. In that case, you can watch for an interrupt on RB4 and jump to a SERIN2 routine (or its equivalent in assembly). You will have to turn off the UARTs interrupt while in that routine, since grabbing a character from the UART's receive buffer would screw up the timing of SERIN. If you checksum your data streams and allow for retries, this should work quite well.
I suppose you COULD measure the RB4 interrupts against a timer and decode the data stream. Difficult, but doable.




Bookmarks