Serial data between two 8051

I would like to have my two 89C51RD2 communicate with each other via UART. They are connected such that one TX pin is connected to the other's RX pin and vice versa.

I tried sending byte by byte and it is working. However, when I tried to transmit larger amount of data at one go, the receiving end isnt able to read the data.

I feel that I am missing something silly. Is the microcontroller able to store the incoming data while I poll and get them byte by byte?

Would somebody please advise. Thank you.

Cheers

Parents
  • "Is the microcontroller able to store the incoming data while I poll and get them byte by byte?"

    You have the code for both ends, so you should be able to work it out!

    A: How long does your receiving code take to receive and store a byte?

    B: How long does your transmitting code take to prepare the next byte for transmission?

    Guess what happens if A>B...?!

    Have you looked at the interrupt-driven, ring-buffered serial IO example on this very site?

Reply
  • "Is the microcontroller able to store the incoming data while I poll and get them byte by byte?"

    You have the code for both ends, so you should be able to work it out!

    A: How long does your receiving code take to receive and store a byte?

    B: How long does your transmitting code take to prepare the next byte for transmission?

    Guess what happens if A>B...?!

    Have you looked at the interrupt-driven, ring-buffered serial IO example on this very site?

Children
More questions in this forum