mmm, maybe it could work, maybe not. Depending what else the PIC do.
Is the other Serial Pin use Interupt? If not, i'll suggest to swap them. Now you'll use the internal USART Buffer and avoid some missing character.
mmm, maybe it could work, maybe not. Depending what else the PIC do.
Is the other Serial Pin use Interupt? If not, i'll suggest to swap them. Now you'll use the internal USART Buffer and avoid some missing character.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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.
Charles Linquist
Bookmarks