+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Full Member level 4
    Points: 1,672, Level: 9

    Join Date
    Sep 2014
    Location
    india
    Posts
    213
    Helped
    1 / 1
    Points
    1,672
    Level
    9

    8051 UART serial communication.

    Dear All,
    I want to send & recieve decimal numbers from UART of 8051.but i don't know how to use sbuf register & other coding of uart.please help.
    Thanks,
    Tepu

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 66,750, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,627
    Helped
    3118 / 3118
    Points
    66,750
    Level
    63

    Re: 8051 UART serial communication.

    Hi,

    You say "decimal numbers"
    A UART transmit is byte wide. Usally 8 bits of data.
    You may see/treat those 8 bits as
    * one character ASCII coded
    * an unsigned integer value with range 0...255
    * a signed integer value with range -128...0...+127
    * two nibbles of BCD with range of "00" ... "99"

    If you are not satisfied with this you need to send multiple bytes representing
    * 2 bytes unsigned integer with range 0...65535
    * 2 bytes signed integer with range -32768 ... 0 ... +32767
    ... or any other byte count integers ....
    ... or (multi byte) floating point
    ... or (multi byte) fixed point
    ... or (multi byte) string
    ... or (multi byte) BCD
    ... or many other representations

    If you want to get a recommendation how to transmit your "decimal value" then you first should specify it's range and resolution (or number of fractional decimals)..

    Klaus
    Please dont contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--