How well can you define the uart protocol

Hi,
I would like to present my answer before asking someone to answer

"Uart is a communication protocol through which a device can send data to other device or receive data from other devices.

For example we can send data from microcontroller to personal computer or we can receive data from personal computer to micro controller

A UART frame requires a start bit, a data bits, optional parity and a stop bit."

How well can you define the uart protocol fo?

I assume that you have seen Serial.begin() - Arduino Reference

No. A UART is a piece of hardware.

1 Like

I've started with defining UART protocol back in the late 1980's and have been refining my UART protocol definition since then. I think that my definition of UART protocol is quite well defined.

1 Like

what is your definition for Uart protocol?

True but in many places it is considered as protocol so I consider it as both protocol and hardware.
That's why I have asked that if you want to define uart protocol, how will you define?

I'll show you mine if you show me yours. I do know I use the definition that works. DOes yours, work that is?

When "UART" is read as "Universal Asynchronous Receiver and Transmitter", then "UART" is a piece of hardware.

When "UART" is read as "Universal Asynchronous Reception and Transmission", then (from my point of view) "UART" is a protocol that covers both hardware and associated software.

2 Likes

If you mean which protocol should be used then there are many to choose from

If you mean how do you set which protocol will be used by the Arduino then see the link that I previously posted

I have already shown my definition in post one. I think this is my best definition, maybe it can be improved by others' opinion.

i like your idea it's a good way to remember the difference between the two terms

If you are asked in an interview what is Uart, how would you explain it?
Neither it is a homework nor it is ian assignment question.

I would expect to be asked "what is a UART ?" and would reply that UART is short for "Universal Asynchronous Receiver and Transmitter". It is usually implemented in hardware but can be emulated in software

If I was actually asked "what is UART ?" then I would ask for clarification of the context in which "UART" was used

1 Like

If you are asked in context of "Universal Asynchronous Reception and Transmission" what will be your answer

1 Like

Then, of course, UART refers to the Universal Asynchronous Reception and Transmission of data. The question provides the answer and does not ask for more details

1 Like

This is one of those great examples where half-truths become anecdotal - pushing false ideas farther away from facts.

UART, SERIAL, HARDWARE, INTERFACE, PROTOCOL are all often victims of partially misunderstood origins and meanings..

1 Like

What would you explain If you are asked what is a uart in context of programming?

Perhaps that a UART is a hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable

Can we stop playing this stupid game now or perhaps you would like to provide the answers to your questions

As has been pointed out, your original explanation

is wrong

1 Like

there a numerous serial interface protocols. not sure what you intend to use the serial interface for. banks and other businuess uses such protocols decades ago to share information using modems. a protocol often defines a set of messages, including the start and end of a message and things such as checksums to determine if the messages is received correctly

you could be sharing information between processors (Arduinos). you could as RS-485 to all multiple processors on the same bus which typically use a master/slave relationship to determine which device is allowed to transmit. but you may also just want to use the Arduino IDE serial monitor to send commands to your program

That it's explicitly handled somewhere below the HAL.

in today's PCs, the application program, similar to someone writing an Arduino sketch, simply calls a sub-function to send a string of bytes out a serial interface. An Arduino Mega has 4 Serial interfaces Serial, Serial1, Serial2 and Serial3. these sub-functions (e.g. serial.println()) simply queue the bytes on an output buffer and initiate transmission

lower level firmware, often driven by interrupts, will copy the bytes from the buffer to the UART hardware which us integrated on the chip with the processor. the UART hardware will prefix a start bit and add parity and stop bits and output those bits, include the bits in the data byte out on a pin at the specified bit rates.

similarly, lower lever firmware, driven by an interrupt, will recognize and the UART has received a byte of data, and move it to a buffer that can be read by upper level functions (e.g. Serial.available() and Serial.read())

1 Like

The serial interface was almost always synchronous, rather than the wasteful asynchronous, because message length would often exceed 2,000 bytes.
The protocol also defined timing for responding to messages, defined error correction procedures, and removing devices from access and the time to reinstate the communication to the device.