Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8051 UART serial communication.

Status
Not open for further replies.

tapu

Full Member level 4
Joined
Sep 15, 2014
Messages
234
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
india
Activity points
3,041
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
 

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
 

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.
 

Thank you for reply,
I am using 89S52.I use c language in coding.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top