This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UARTS on STR91XFAW

Hi
I am trying to use UARTS on my board which has a STR91XFAW_128 MCU.However on trying to simply send data from the board to hyperterminal I am not getting the correct data.If anybody has sample code for the same can they please post a link to it.Also does the baudrate used dictate the performance of the UARTS.

Parents
  • I should have been more specific I guess.What I meant was that I have set the Baud rate of UARTS at 9600 and am using hyper terminal also set at the same baud rate to receive.now if I were to change this baud rate for both receiver and transmitter to say 130202,then should there be any difference.

Reply
  • I should have been more specific I guess.What I meant was that I have set the Baud rate of UARTS at 9600 and am using hyper terminal also set at the same baud rate to receive.now if I were to change this baud rate for both receiver and transmitter to say 130202,then should there be any difference.

Children
  • For low baudrates, you can normally configure your microcontroller very exactly.

    For higher baudrates, the granularity will increase, i.e. if you change the baudrate divisor one step, the error percentage will increase.

    In some situations, you may be able to use a crystal (or PLL configuration) that allows you to perfectly match all standard baudrates. But with wrong input frequency sent into the baudrate generator, the produced baudrate may become so much off that ou are starting to get broken transfers.

    With higher baudrates, the sensitivity to cable lengths, grounding etc will also increase.

    Have you verified your baudrates with an oscilloscope? Just have your microcontroller send sime data, and measure the bit length - how close is it to the expected baudrate?

    Are you using any FIFO or similar when receiving? Are you sure that you are reading out the data fast enough so you don't get a lot of lost bytes?

  • For a start, do you have a COM port on your PC which supports that?

  • Yes, it's the same thing with the PC as with the microcontroller. The baudrate generator have a fixed-frequency clock that gets divided to produce the requested baudrate (or normally 16 times the expected baudrate because of oversampling).

    At higher baudrates, it's important to compute or measure what the actual baudrate will be. Too much off because of rounding errors, and the transfer will not be reliable anymore.

    It's easier when two identical producs are communicating, since then the baudrate will be similarly off on both ends.