what are you using for your oscillators? having the last bits come up wrong sounds like a frequency mismatch. uarts rely on timing from the start bit so the errors add up over the course of each transmitted byte.
in other words if you have a 10% bit rate mismatch and 8N1 coding for 10 bits per transmitted byte (1 start bit, 8 data bits, no parity, 1 stop bit) you completely lose the last bit.
I am using crystal oscillator. Baud rates for both the MCU are 57600.
But the frequency of the crystal oscillators are 50000 and 80000. Is that a problem? I am using no parity.
I have checked the total thing thousand times and I
never get anything wrong for the last 4 bits. But for the upper 4 bits it follows the pattern like:
should receive---------actual receive
1------------------------9
2------------------------A or 8
3------------------------B or 9
4------------------------8 or A
5------------------------9 or B
6------------------------A
7------------------------B
8------------------------C
9------------------------D
A------------------------C or E
B------------------------D or F
C------------------------E or C
D------------------------F or D
E------------------------E
F------------------------F
Please help me