Hi,

I try to read out the two serial port inputs of a Pic18F6720 at the same time.

Because I dont want to miss a byte, I dont use hserin.

In my code I look as fast as it is possible with my 4 Mhz clock if one of the buffers of the serial port are filled, when one buffer is filled I read out the buffer and look again if one of the buffer is filled. My problem is that when I read e.G. "ABCDEFGH" in always some chars are discarded. My result-array is filled e.G. with "ABCGH".

My samplecode:

DEFINE HSER_BAUD 4800

CHARIN: CHAR = 0
If PIR1.5 = 1 Then
CHAR = RCREG
RCSTA.4 = 0
RCSTA.4 = 1
Endif
Retunr

When PIR1.5 = 1 means that the buffer of the first serial Port is filled with a char, right?

After the CHARIN- Sub I should have at 4800 baud approximately 2 mseconds for another task befor the next byte comes into the two- byte- input- buffer of Pic18F6720. But that doesnt work. It did some tests, and it seems that I have just some µseconds time for another task.

Can anybody help me?

Best Regards,

Tomas