how does UART work??? (explained clearly)
Vložit
- čas přidán 31. 08. 2017
- UART is one of the many ways that computers communicate with each other. In this video I explain how UART transmission works. It all comes down to how voltages represent bits that make up binary data. In my demonstration I am using an Arduino board to generate The data signal and a RIGOL DS 1102E oscilloscope to visualize that signal. Comments, questions, and concerns are welcome. Thanks for watching!
Well done. I'm a old timer in electronics but never got into computers. Now that I'm playing catch up I'm having a hard time finding a place to go for good explanation of things. You did a great job. Keep it up
Phillip, Hi mate
I'm also an old timer in electronics, Now we can debate who is the older old timer by all means :P but let's wait until formal introductions have taken place shall we because i could turn out to be the old fart (who knows)
Anyway mate, if you want to play catch up, Feel free to contact me
i'm also an I.T. Engineer so you can ask me about Electronics (although i imagine you won't need to ) and you can ask me anything about computing and telecommunications.
and let's be honest, (at least back in my day ) what computers was there to get into ?
i mean for me it was Atari and Commodore 64, yes we had Pear, Wang and so on by who had one of those... i never knew anyone
and yes i did get into Basic Programming at the tender age of around 8 (or thereabouts) but other than that we had our good old 150 in 1 Dick Smith Electronics kits and we tinkered with Electronics so yeah not everyone got into computers
so.. Feel free to ask and play catch up if you want mate, i'm happy to have a chat anytime you are we can do skype , zoom whatever, have a chat , talk some shit, whatever tickles your fancy
Be cool mate
This is a perfect explanation of UART and I like how you covered baud rate and the fact that it transmits by LSB first.
You have no idea how much just cleared up in my head. Usually when I watch the video I’m like, “yeah but why?” Thank you for explaining EVERYTHING
Great starting point for those looking to understand UART without going into math. I’m sure this video will continue to be useful for sometime to come. 👍 from me! 🇬🇧
That's about the clearest I've ever had anything explained to me. You've earned a subscriber.
bit-by-bit, this video adds to my understanding of UARTS... thanks
Thanks a lot! That's what I call "clear explanation".
Thanks a bunch for this clear explanation! Makes perfect sense. Your drawings helped to visualize what is happening.
Thanks for that. It was pretty smooth way to explain UART.
Watched this today for my exam, helped a lot in understanding how UART actually works, thanks a bunch
Thank you for making this video. Dummies like me usually have a hard time with concepts like this. I appreciate your thorough explanation.
George McFly you're awesome at explaining UART. Thank you!
Huge thumbs up. Your video explains what the greedy colleges of mine on a job I left didn't want to explain to me. A huge thumbs up for your job!
Finally an explanation with a real world example
That helped a lot
Top work mate. I am a sparky and am familiar with a lot of concepts but UART is not one. This is a great explanation.
This is ace! I’ve used comms for years between devices, and taken that it’s always worked. Setup the correct comms settings and away it goes. but I’m now at a stage where I’ve got to take comms signal from an old device and manipulate it to deliver something readable. This has helped me understand how it is sent and received. Knowing this gives me some idea how to move forward from here. Thanks!
Great!! Simple and clear, without not unnecessary details!
great, simple to grasp, well done!
Great video, I wonder why CZcams waited so long to promote it!
One small correction though, baudrate is not necessarily the same as the nitrate. In the simple case of UART, it is. Baudrate is defined as the number of change to the signal per second. In modulations like QAM, the baudrate is lower than your bitrate, as one phase shift encodes more than one bit.
Excellent intro. Thank you!
Thank you for this clear explanation ❤💯
Cool presentation man, I totally get it now. Well done!
O wow 😂😂. No seriously this is the best explanation about data transmission. Thanks for making this video
Very clear explanation. Thanks.
I have experimented with my Arduino and with oscilloscope device is really fascinating what we can do! I made my own code for communicating with my computer (very easy) and it works! People even don;t think that there are thousands of possibilities and only open mind is needed for ideas! People seem to be like sheeps. One man invents something and then everybody uses it but withut realising that there is not only one solution or way how to do it and how to communicate , send/ receive signals etc. Just my own reflection ;)
Thanks, Great explanation.
super well explanation of this , clear and easy to understand. please continue with this :-)
WOW!!!
It was amazing!
Thank you so much
very good explanation sir , as gentleman below said it is the clearest ....so now im very clear..thank you for your works, you got another subscriber too
Thx man you really helped me with my school presentation
Great explanation, thanks!
Thanks! Very well explained.
Great video, Thank you!
Thank you for the education!
Thanks man, it was very clear.
Mate Awesome. Well done. Wonderful explanation for beginners.
thanks a lot! this is a clear explanation ^^
Perfect explanation. thx
very clearly explained with example
Awesome explanation!
Thanks, nice clear explanation. 😁
Great explanation sir!
Very well explained.
I learned something, thanks.
aka L I L B R O O M S T I K
very clear explanations.....
I learned something today! :-)
Nice info, well done, thanks for sharing it:)
Left-handed people explains it better. Cheers ma lad!
Amazing explanation
Very good video, thanks
Good Job! Many Thanks.
I'm watching your video to help me review/understand UART before diving into learning how to use it on a dsPIC33.
But I notice quite clearly that you're left-handed. I am not, but my dad is. It is a foreign world to me. My dad may still have his left hander's coffee mug, which has a hole on one side (and thus a limit to how much you can fill it), restricting it to be used with the left hand. Right handers will spill coffee on themselves with it unless they awkwardly try to cover the hole with their lower lip.
Great vid, thanks
loved this video
Can you also make similar video explaining SPI, I2C as well?
how much the delay time between start and the first binary code? and also after the last binary code (8th bit which is 0 in regular ASCII) how long the time delay. This is very important to differentiate between each byte data when sending and receiving.
so with 9600 bps (9600 baud rate with 1 bit per signal), 1 bit closely to 104.1667 microsecond pulse time right? What is the maximum baud rate can be used (or bps) for arduino uno with 16MHz oscillator?
in your oscilloscop, what pin was used for positive terminal?
Very good tutorial video.
Thanks. Please for good
explaination !
Hello👋,
@Continuous Load YTchannel..
Thank you So much for sahring valuable information...👌
It's very helpful to easy and real understading of UART Protocol...
way of explaining and output showing on Digital oscilloscope.
Would you plz tell me how did you give the message to the arduino..? I'll be more helpful to understand that clearly..
Thank you very much! Subscribed for clear explanations :DD
Very Nice!!!!! Thank you
exceptionally simple
Can you recommend your 1102? I am shopping for scopes now and it seems to be popular.
so when a company like espressif makes their mcu and its flashed using uart, is there a standart for bits that would represent "start" "stop" "acknowledge" etc, or is that purely determined by the product manufacturer?
super clear!
Thank you!
very good...keep going
Thank you man
What if the first and last bits are 1s? How does it know when to start reading the high bit and/or to stop reading the last high bit since it starts high?
Thanks for the video.
thank you so much
Meanwhile on The Discovery Channel: "How to know when it's time to blow your nose" 😉
thank you!
Thank you, very well explained and demonstrated video although the scribbling at the beginning was a bit irritating for me, how did you connect the oscilloscope to the pins....is it Tx and ground?
Yes, it is Tx and ground. And yes, I could have used a better format than scribbling :) I think that it feels natural to teach electronics with pen and paper, but it is difficult to do correctly on film - I'll have to experiment with my approach. Thank you for the respectful comment. If I may ask, what improvements would you do with the format?
Hi there , are you sure you have connected only TX & GND and not TX+RX & GND ?
While what you did explain made sense and was clear I wish a brief rundown of how you sent the bits took place.
Really nice vide
Hi, how much time uart timeout in Rx buffer, in the loop. Is it available on whole time when no new data coming in?
Thx for answering...
Thanks. Really good explanation. Small question, How much time it takes to transmit the first bit after the start (falling edge)?
Both a start condition and a stop condition last one "bit cycle." That means that to transmit 8 bits of data, it actually takes 10 bit cycles! Remember that the bit cycle is the inverse of the baud rate, so if I am running at 115200 buad, my bit cycle is 1/115200 or 8.7 microseconds. If you take a look at the oscilloscope at 10:13, you can see that the voltage stays at 0 after the falling edge for about ~9 microseconds (each grid block on the screen represents 20 microseconds) before going high for the first four data bits (which where all 1's). Does that make sense?
Continuous Load . Yes. Thank you very much.
Thank You
beautiful
AWEOME LECTURE
The serial in the arduino case is ttl level and not usual rs-232. That means it is inverted and in a different voltage range like 0-5v and not +/- 2.5 v or all the way to +/- 15 v.
How does the receiver know that the end condition is the end condition, instead of a whole load of 1's?
Because you (the master/slave) know in prehand what the baud-rate and total number of X data bits (where X is 5-9 bits) are, also the optional parity bit. So it knows that the stop bit should be after the X bit.
@@erblinas4423 If everything is based off of timing there must be an initial sync right? When and how does that happen? Also, how long does the UART wait between bytes to send the next byte?
@@4wheeldrifting the start bit is the intial sync and the end bit is responsible for the delay between bytes
@@4wheeldrifting it is because the Rx and Tx are already configured to the same baud rate before the transmission of data occurs..so when the bits are transmitted from Tx to Rx a stop bit is generated to tell Rx that transmission is completed and thus the Rx prepares itself for the next transmission in the meanwhile...
very nice thanks
Спасибо. Понятно, интересно.
thanks a lot !
+P Abhijith Glad I could help.
Is there a way to identify a UART signal coming from a mobile app via bluetooth, being sent to a Bluetooth dongle attached to a device receiving the signal? How could I identify or replicate the signal?
Really good overall. Better audio, better lighting and more practice would make this a great classroom lecture even.
Appreciate the comment! And who knows, maybe it will be a classroom lecture someday :)
You advice sounds like it comes from experience. Have you / do you teach classes?
@@continuousload3963 The audio is already better than many other videos, but I will second the request to use a writing implement that doesn't make scratchy sounds over headphones or audio that is turned up.
Thanks sir
Helpful
Play at 1.25x speed and no thanks needed.
thanks
Thats Great! thanks
Madhav Humagain thnz
its even better at 2x speed :)
hahahahaha, I didnt expected result so perfect like this xD
Whats the use of clock pule in uart and the receiver,and how it helps to transfer the data ?? please explain that ..
Good question. UART is different from other serial protocols (like SPI or I2C) because it doesn't use a clock pin at all. This of course means that both the sender and receiver must be pre-configured to use the same baud rate. For example, if I have an Arduino sending a message at 9600 baud (bits/second), I need to tell the Serial Moniter program on my computer to listen at 9600 baud as well, otherwise the bit values will get read at the wrong time.
Does that answer your question?
Some serial protocols do use a clock pulse. Consider SPI (Serial Peripheral Interface) which has a clock pulse wire to signal the receiver when to read the next bit. As a result, baudrate does not matter to SPI devices since the master sets the pace with the clock pulse.
@@continuousload3963 I have been long mystified by parity bits and how it is able to verify data integrity. If there is only 1 bit that flipped, then the parity bit can detect the corruption and will therefore cause a retransmit. However, the parity mechanism cannot detect if there are two bits that flipped. Can you shed some light on this aspect ?
@@dexteraparicio7418 you are absolutely right - the use of a parity bit is only good for detecting an odd number of corrections - if one or three or five bits are corrupted, the parity bit will change, but if two or four or six bits are corrupted, the parity bit will remain unchanged and the corruption will go undetected.
Thankfully having two bits corrupted is statistically less likely than only one, but in a system where data integrity is critical, the person designing the system will have to implement a more advanced error detection protocol. That said, considering how cheap the parity bit is to compute, you might as well use it since it's there :)
thanks !
i had a question if i send a long string "this is a demo", does it still sent binary from the end of sentence ?
the string is split into characters, that is 't' 'h' 'i' 's' ... and then each character is sent as binary, but you send the first character, that is 't' from "the end", so you send the first letter from LSB to MSB, then h LSB to MSB, and so on
I would like to know the source code you wrote in arduino IDE ?
9:16 4 cycles would be 1÷9600 = 104uS this would be one bit every 104uS? Is this correct?
Great explanation! Can you please publish the code that your Arduino is running for this demo? THX!
What happens if there is a 1 on the far left? How to tell the difference between that and the usual "no data" state?
Hello sir not understand one question. hare impossible convert this uart wired to uart no wired?
I need extend distance for one display connected with 4 wire.
Do you have solution?
Thank s👍
Sir, I am trying to receive gps data each second using interrupt function.What I understood is that,I had enabled the global interrupt in stm32 configuration for uart3, and whenever the interrupt triggers,the programs goes to the callback function which is hal_uart_rxcpltcallback.The program reaches the function..I do some processing again and then enable the interrupt again..The next sexond when the data arrives at 100ms after a pps signal(reference signal marked for 1 second),again interrupt is triggered , program goes to callback function, does the particular function, comes out of callback function.This happens in every 100th -130th millisecond of each second.I understood that whenever the codes enters the callback, ,the interrupt is diabled and we need to enable the interrupt again to receive the next data..Altogether 300bytes of data arrives from 100 to 130milliseconds..After 130 milisecond,if suppose some random data arrives, the interrupt may still trigger, since each time i enable the interrupt while coming out of callback function..how to stop receing the interrupt after 300millisecond? Can i use abort function?? Also can you please explain What is the differnce between isr function and callback function??Looking forward for your reply