Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

UART Basic Before Writing Code

Presidint

New Member
I have 8051 microcontroller and using Keil, and before jumping into coding, I feel it's better to get a solid understanding of some basic concepts.

I have a couple of questions that I’m a bit confused about:

When we talk about terms like UART, do we refer to it as hardware, software, or protocol? Sometimes I see them used in different ways, and it’s not always clear to me.

To keep it simple, can I refer to it as hardware modules inside the microcontroller? Is that a correct way to think about it?

Also, if UART is considered a software protocol, how can it be full duplex? In code, I usually see we either send or receive a character, not both at exactly the same time. But as per the definition, full duplex should mean sending and receiving can happen simultaneously. Could you please clarify how that works in practice?
 
Also to add to JRW, some people will tell you Software serial is a) too slow b) non interrupt

Both comments are wrong.. I have implemented a full duplex software Uart. But it will hog the interrupt. On the old 8052 series, you can use an interrupt pin and stick it on a decent priority.
Nothing will be better than hardware though...

As regards to protocol.. this is just the "method" of transfer.
You can use the RS232 protocol on a RS485 hardware it just means what bits are what. RS232 has this protocol..
"BAUD","stop bits" and "Parity" Just so both connections can talk to each other.

9600 baud, 1 stop bit and even parity is pretty much the norm for me.
 

Latest threads

Back
Top