Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

UART and RS232

hi. Is UART have to be used with RS232 only or vice versa?

I am using hyper terminal to test the communication. The data received is in weird symbol before changing to ascii code. Actually the weird symbol is what kind of standard or anything?

Thanks

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    RS232 is the physical interface describing its electrical specification.

    There is also RS422 or RS485 as an example. (the is also a 20mA current loop very common)

    The UART is controling the transmission of information over the physical interface.

    If you receive weired stuff befor you see ascii then one thing could be that at the beginning both sides are not syncron in transmission. your pc with hyper terminal thinks that databits are the startbit / stopbit until the synchronize into the correct start stop bits of the data stream.

    thats why there are protocols over such data streams are used to enshure the receipt of a complete transmission.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yes

    Like your musik system at home, the UART is the amplifier and if you use a headset (RS232) or loudspeaker (RS485) doesn't matter how the information is transmitted by using different interfaces
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    O i c. Actually what determine the communication in specific format(string, boolean etc) since UART is just a handling on serial and parellel 8-bit data manipulation?

    In other words, how to receive the data is in string format?

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The UART is converting from parallel to seriell und vice vera by controling the transmission, but no interpretation of the information that is transmitted or received if we forget the break condition for a moment.

    the interpretation is done in software.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    An UART usually transmits 8-Bit data. The meaning of the data has to be defined by the application, it can use binary as well as ASCII formatted ("string") data. Typically, printf() and scanf() functions of a C compiler are used for ASCII encoding and decoding of data. Compiler user guides and programming language text books should answer all respective questions.