UART

1.0 What is UART

UART stands for Universal Asynchronous Receiver and Transmitter it is serial communication protocol that sends parallel data, in a serial and asynchronous way.
Serially here, means data are being transferred bit by bit i.e. one after the other compared to parallel transmission where all data bits are transferred at once.
Asynchronous means that the receiver and transmitter do not share a common clock, i.e. they are not being synchronized compared to other synchronous transmission like SPI as we would see in another tutorial. It is also known as Serial port, Com port, RS-232.

1.1 UART configuration parameters

To configure UART some parameters need to be configured.
1.     Baud rate – This is the number of bits sent per seconds. Both Tx and Rx will agree at the rate of data bits to be sent per second. Standard baud rates include
300bps, 1200bps, 2400bps, 4800bps, 9600bps, 19200bps, 38400bps, 576bps, 115200bps.
2.     Number of data bits – The Tx and Rx also have to decide the size of each data frame whether 7 or 8bits or more.
3.     Parity bit – Parity bit is used to check for single bit error or errors of odd number of bits. It is configured to be either on (i.e. parity bit is transmitted) or off (No parity bit in transmission)
4.     Stop bit – The stop bit is also configured to be either 1, 0 or 2.
5.     The transmission can also be configured as simplex (Where data is sent in one direction only), half duplex (Data is sent in both direction but one at a time) or full duplex (Both sides can send and receive data simultaneously).
A typical UART data is transmitted serially in groups called frame as shown below


1.2
In the above diagram, initially before any transmission the data lines are held high or 1, this is indicated by the two points marked line idling in the diagram above, it means no data is being transmitted. To send a data a low or 0 is first transmitted to let the receiver know that data is being sent this low bit is called the start bit. This start bit is then followed by the actual data bits to be sent which can be 7 or 8 or other values depending on the configuration already agreed by the Tx and Rx.
The first bit of the data bit to be sent is usually the LSB (least significant bit), by this way the receiver also receives it first. The next bit is the optional parity bit. It depends on the configuration between Tx and Rx whether the parity bit should be present.
Then lastly, the stop bit and then the line goes back to high till next data transmission.
The parity could be even or odd parity. The even parity bit is a zero when there are even number of 1`s and a 1 when there are odd number of 1`s. While the Odd parity bit is a 0 when there are odd number of 1`s and a zero when there are even number of 1`s. This is shown in the table below.


1.3 Example Calculation
Assume a data transmission requires 19200 baud to send 8 data bits with one start bit, no parity and one stop bit
•     What is the frame size?
•     What is the data throughput or bandwidth of transmission in Kbps (Kilobits per seconds) and KB/s (Kilobyte per second)?
Solution --
•     1 start bit + 8 data bits + 1 stop bit = 10 bits
It takes 10 bits to send 8 bits (1 byte) of data at 19.2 kbps. Frame size is 10bits. •     8 data bits / 10bits (frame size) * 19200 = 15.36 kbps
•     How many KB (kilobytes) per second is this? –
15.3kbps = 15300bits/s
    *8 bits =1 byte
15300bits/s = 1912.5 bytes/s
    *1,024 bytes = 1 KB
1912.5 bytes/s = 1.875 KB/s





John Doe
0:36:15am On 2018.10.15
nice one, very satisfying explanation in logism.
John Doe
6:43:19pm On 2018.12.23
nice one, .
John Doe
1:32:43am On 2018.10.5
Thnku so much for such an easy explanation.
John Doe
10:53:25pm On 2018.12.5
EPIC explanation thank you!.
John Doe
4:5:23am On 2018.10.25
great work ,hope you make an explanation how to set baud rate according to clk freq..
John Doe
12:54:18am On 2022.04.16
https://bestadalafil.com/ - cialis price Kpljyh <a href="https://bestadalafil.com/">Cialis</a> Owcoxt https://bestadalafil.com/ - Cialis Vente Xenical.
John Doe
12:04:12am On 2022.09.15
free gay bays chat cookeville tn gay chat <a href="https://free-gay-sex-chat.com/">frree gay and bi chat sites in seattle wa </a>.
John Doe
07:21:27am On 2022.09.16
gay boy chat <a href=https://chatcongays.com>gay black man chat</a> gay men snap chat.
John Doe
02:39:53am On 2022.09.20
custom essays review <a href=https://au-bestessays.org>essay cheap</a> essay writer program.
John Doe
09:52:54pm On 2022.09.20
write my essay review <a href=https://bestcampusessays.com>sat essay help</a> best college essay writing service.
John Doe
08:13:33pm On 2022.09.21
help in writing an essay <a href=https://besteasyessays.org>cheap essay</a> essay writing services legal.
John Doe
04:11:15pm On 2022.09.22
essay custom <a href=https://bestessayreviews.net>help in writing essay</a> narrative essay writing help.
John Doe
11:57:18am On 2022.09.23
essay writer services <a href=https://bestessaysden.com>cheapest essays writing services</a> college essays help.
John Doe
01:33:59am On 2022.09.25
essay proofreading services <a href=https://bestsessays.org>writing essay service</a> best essay services.
John Doe
08:32:43pm On 2022.09.25
buy cheap essay online <a href=https://buyacademicessay.com>essay on social service</a> english essay writing help.
John Doe
04:12:16pm On 2022.09.26
essay writing services review <a href=https://buy-eessay-online.com>law essay help</a> help with writing college essays.
John Doe
06:12:35pm On 2022.09.27
lsd traffic notification <a href=http://bag33ondu.com>bag33ondu.com</a> <a href= http://bag33ondu.com >bag33ondu.com</a> http://bag33ondu.com fortified abreast artichoke .
John Doe
07:11:18am On 2022.09.28
best online essay writers <a href=https://cheapessaywritingservice1.com>best online essay writing services</a> essay writer funny.
John Doe
03:08:31am On 2022.09.29
discount essay writing service <a href=https://customcollegeessays.net>essays about community service</a> can someone write my essay for me.
John Doe
10:46:28pm On 2022.09.29
buy essays <a href=https://customessays-writing.org>help write essay</a> custom essay papers.
John Doe
05:38:24pm On 2022.09.30
how to write my essay <a href=https://customessaywwriting.com>common app essay help</a> buy cheap essay online.
John Doe
04:31:04am On 2022.10.03
best custom essay writing services <a href=https://geniusessaywriters.net>essay writers</a> cheap custom essay writing services.
John Doe
02:24:50am On 2022.10.04
pay for essay cheap <a href=https://howtobuyanessay.com>custom essay writing help</a> essay on social service.
John Doe
03:58:33pm On 2022.10.06
9 sД±nД±f almanca Г§alД±Еџma kitabД± cevaplarД± sayfa 11bein sport canlД± izle Еџifresiz matbet <a href="https://tee-shirts.online/general-mobile-air-en-ucuz.php">general mobil.
John Doe
02:26:39am On 2022.10.07
essay writing service law <a href=https://lawessayhelpinlondon.com>essay writing service forum</a> english essay writers.
John Doe
02:18:38pm On 2022.10.09
write my essay online <a href=https://lawessayhelpinlondon.com>helping others essays</a> write my college essay for me.
John Doe
08:37:58pm On 2022.10.11
essay help sites <a href=https://ukessayservice.net>buy custom essays online</a> in an essay help you guide.
John Doe
11:39:02am On 2022.10.13
custom made essays <a href=https://writemyessaycheap24h.com>academic essay writing service</a> buy essay online for cheap.
John Doe
09:32:01am On 2022.10.14
<a href="https://turhaberleri.online/">Türkiye Haberleri</a>.
John Doe
03:15:56pm On 2022.10.19
At age 50, she had undergone a total laparoscopic hysterectomy because of pain and an adenomyotic uterus <a href=https://buylasixon.com/>how to make lasix work better</a>.
John Doe
06:02:25am On 2022.11.16
cheap essays online <a href=https://au-bestessays.org>essay editing service reviews</a> custom essay writer.
John Doe
08:31:11am On 2022.11.19
help me write my essay <a href=https://bestcampusessays.com>custom my essay</a> us essay writers.
John Doe
03:25:37pm On 2022.11.20
best essay writing services <a href=https://besteasyessays.org>order essay online cheap</a> fast custom essays.
John Doe
11:15:07pm On 2022.11.21
automatic essay writer <a href=https://bestessayreviews.net>service to others essay</a> discount essay writing service.
John Doe
08:09:32am On 2022.11.23
looking for someone to write my essay <a href=https://bestessaysden.com>will someone write my essay for me</a> admission essay editing services.
John Doe
03:50:33pm On 2022.11.24
best essay writing service online <a href=https://bestsessays.org>essay online help</a> law essay writing service.
John Doe
01:10:16am On 2022.11.26
custom admission essay <a href=https://buyacademicessay.com>custome essay</a> good customer service essay.
John Doe
10:32:40am On 2022.11.27
custom application essay <a href=https://buy-eessay-online.com>critical essay help</a> buy essays cheap.
John Doe
09:44:50am On 2023.01.25
coursework writing uk <a href=https://brainycoursework.com>courseworks help</a> coursework.
Jane Doe
12:15:01am On 2023.02.05
Are you tired of spending countless hours writing emails, reports or chatting with customers? Jasper AI is here to simplify your life. Our AI writing and chat tool will help you save time and effort while improving the quality of your work. With Jasper
John Doe
01:02:42am On 2024.01.02
<a href=http://prilig.mom>buy priligy 60 mg</a> The application of nanoparticles in medical research has fundamentally revolutionized the specificity of anticancer drugs which are frequently associated with therapeutic side effects.
John Doe
06:04:03pm On 2024.07.15
2010 Feb; 25 2 221 30 <a href=https://cialis.lat/discover-the-best-prices-for-cialis>cialis 20mg price</a> A positive correlation has been demonstrated between migraines and serum CGRP levels, and after the pain of a migraine subsides, levels .