+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Member level 2
    Points: 2,057, Level: 10

    Join Date
    Mar 2003
    Location
    Iraq
    Posts
    46
    Helped
    0 / 0
    Points
    2,057
    Level
    10

    hyperterminal set priority

    Hi,

    Why does my 89c51 communicate with the pc via serial port very well in speed 9600 bps or less , and any speed over 9600 it will give garbage.

    Is there a large tolerance in my 11.059Mhz crystal?

    •   AltAdvertisment

        
       

  2. #2
    Member level 3
    Points: 1,866, Level: 10

    Join Date
    Jan 2004
    Posts
    64
    Helped
    2 / 2
    Points
    1,866
    Level
    10

    Re: bood rate problem

    Hi hayder78,

    I always used HyperTerminal (on PC side) , when testing comunications with a new RS232 board.

    First Check if the Baud Rate is set corectly in HyperTerminal.


    If your program still don't work at higher baud rates, you have a probably a software bug

    Most probably, you TX/RX bytes without properly check/reset the TI,RI flags.

    For example you are not allowed to TX a new byte until the previous byte is not completely sended



    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 5
    Points: 74,061, Level: 66

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,942
    Helped
    2329 / 2329
    Points
    74,061
    Level
    66

    Re: bood rate problem

    It is unlikely that you experience timing problems but it is possible that micros are busy doing something else.
    If possible use command-response protocol and/or interrupts. For example, in 51core the serial interrupt is of the lowest priority but you can set priority bit and make it high.



    •   AltAdvertisment

        
       

  4. #4
    Member level 2
    Points: 2,057, Level: 10

    Join Date
    Mar 2003
    Location
    Iraq
    Posts
    46
    Helped
    0 / 0
    Points
    2,057
    Level
    10

    Re: bood rate problem

    The error is in the hyperterminal when the 8051 send in these bood rates (more than 9600)!!



  5. #5
    Full Member level 1
    Points: 1,809, Level: 9

    Join Date
    Dec 2004
    Location
    New South Wales
    Posts
    106
    Helped
    9 / 9
    Points
    1,809
    Level
    9

    Re: bood rate problem

    Quote Originally Posted by hayder78
    Hi,

    Why does my 89c51 communicate with the pc via serial port very well in speed 9600 bps or less , and any speed over 9600 it will give garbage.

    Is there a large tolerance in my 11.059Mhz crystal?
    A 11,059 crystal oscillator shouldn't have any error (error rate=0), as long as you correctly setup the baudrate in your micro, using correct constant values for the timer.

    Are you sure you had made appropriate changes in your flash program ?

    If there is no problem with the software, perhaps you should check the quality of your hardware. You should never underestimate NOISE! Using a better PCB does help :)



  6. #6
    Junior Member level 3
    Points: 1,826, Level: 9

    Join Date
    Nov 2004
    Posts
    26
    Helped
    0 / 0
    Points
    1,826
    Level
    9

    Re: bood rate problem

    Make sure that you are set at the same baud rate on both ends. Look at your timing in your code and make sure that you are respecting it. Before you transmit make sure that the receiving end is not busy and is ready to receive more data (use interrupts or polling routine services). On the RX side make sure that all of your data has been received before you start doing something with it.

    You may think that these are basic steps and suggestions but major part of the time they are the source of most of the problems with data communication.

    After you've checked and made sure that you are respecting all of this, and you are still facing the same problems just blame it on the hardware ;)

    hope this helps
    s2c97



    •   AltAdvertisment

        
       

  7. #7
    Member level 3
    Points: 1,737, Level: 9

    Join Date
    Dec 2004
    Posts
    62
    Helped
    3 / 3
    Points
    1,737
    Level
    9

    Re: bood rate problem

    Surely its due to some initailisation problems.. 8951 is pretty stable at higher baud rates as well.



--[[ ]]--