Serial Communication in 8051 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Serial Communication in 8051

Dear Friends,
I transmitted series of strings in 8051 assembly program(Of course by checkinh the TI Flag).
Code snippet is
CLR TI
MOV SBUF, 30H
JNB TI, $

CLR TI
MOV SBUF, 31H
JNB TI, $
...... ...... ...... It goes like this

When I checked the received data with the same baudrate set in hyperterminal , There is a mismatch.I got junk characters.But after adding a small delay loop for about 20milli seconds after
JNB TI, $ , the code works fine in hyper terminal.Is the delay loop really needed between transmissions or there was a problem in hyperterminal.Please suggest me whether the delay loop is really needed.
Thanking You

Comments

  • jpablormzjpablormz Posts: 2Member
    I don't think it is necessary at all. I had a similar problem, and corrected it by choosing a different baud rate. Since the formula for the recharge value of the internal timer that sets the baud rate rarely gives you an integer value, try different baud rates that deliver a near-integer value for TH1 with the mentioned formula. If no desired baud rate gives you a working TH1 value, consider changing you oscillator cristal (rarely necessary). I hope that works for you, if the problem persists, post again.

    : Dear Friends,
    : I transmitted series of strings in 8051 assembly program(Of course by checkinh the TI Flag).
    : Code snippet is
    : CLR TI
    : MOV SBUF, 30H
    : JNB TI, $
    :
    : CLR TI
    : MOV SBUF, 31H
    : JNB TI, $
    : ...... ...... ...... It goes like this
    :
    : When I checked the received data with the same baudrate set in hyperterminal , There is a mismatch.I got junk characters.But after adding a small delay loop for about 20milli seconds after
    : JNB TI, $ , the code works fine in hyper terminal.Is the delay loop really needed between transmissions or there was a problem in hyperterminal.Please suggest me whether the delay loop is really needed.
    : Thanking You
    :

Sign In or Register to comment.