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
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)..
which micro controller you are using of 8051 ?
and in which language you are coding , assembly or c ?
the moment you place data on sbuf register ,it start sending or receiving, you simply need to monitor RI or TI FLAG to the transmission and reception is completed.