bitsurfer
Member level 3
Hello,
While I can send data to computer well, and from computer too I have problems with accurately receiving data to 8051 mC.
Here is my VB.NET code for sending bytes:
For sure, this code sends 2550 bytes.
And here is C code for receiving bytes:
By watching variable receivedBytes it take only 190-210 bytes (every time different) because computer dumps data to port without any synchronisation.
Is here any technique or method to receive full data fast and proper?
I also try receiving data with serial interrupt with same results.
This is, of course, not usable in any practical application.
What to do here?
While I can send data to computer well, and from computer too I have problems with accurately receiving data to 8051 mC.
Here is my VB.NET code for sending bytes:
Code:
For a As Integer = 1 To 10
For t As Integer = 0 To 255
Form1.sPort.Write(Chr(t))
Next
Next
For sure, this code sends 2550 bytes.
And here is C code for receiving bytes:
Code:
again:
while(RI!=0)
{
P1=SBUF;
RI=0;
receivedBytes++;
}
show_lcd_received_bytes(receivedBytes);
goto again;
By watching variable receivedBytes it take only 190-210 bytes (every time different) because computer dumps data to port without any synchronisation.
Is here any technique or method to receive full data fast and proper?
I also try receiving data with serial interrupt with same results.
This is, of course, not usable in any practical application.
What to do here?