how does UART work??? (explained clearly)

Sdílet
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!

Komentáře • 219

  • @phillipbartlett1819
    @phillipbartlett1819 Před 4 lety +23

    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

    • @martinkuliza
      @martinkuliza Před rokem +2

      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

  • @xtremejennbase
    @xtremejennbase Před 2 lety +15

    This is a perfect explanation of UART and I like how you covered baud rate and the fact that it transmits by LSB first.

  • @Portergetmybag
    @Portergetmybag Před 3 lety +3

    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

  • @steveng5503
    @steveng5503 Před 4 lety +21

    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! 🇬🇧

  • @execration_texts
    @execration_texts Před 4 lety +2

    That's about the clearest I've ever had anything explained to me. You've earned a subscriber.

  • @playharder1435
    @playharder1435 Před 2 měsíci

    bit-by-bit, this video adds to my understanding of UARTS... thanks

  • @strauss334
    @strauss334 Před 6 lety +23

    Thanks a lot! That's what I call "clear explanation".

  • @johnjacobsen802
    @johnjacobsen802 Před 3 lety +2

    Thanks a bunch for this clear explanation! Makes perfect sense. Your drawings helped to visualize what is happening.

  • @alpyldrm8448
    @alpyldrm8448 Před 4 lety +4

    Thanks for that. It was pretty smooth way to explain UART.

  • @danyjoe7741
    @danyjoe7741 Před 2 lety

    Watched this today for my exam, helped a lot in understanding how UART actually works, thanks a bunch

  • @burlapjack8345
    @burlapjack8345 Před 5 lety +9

    Thank you for making this video. Dummies like me usually have a hard time with concepts like this. I appreciate your thorough explanation.

  • @jimivie
    @jimivie Před 3 lety +1

    George McFly you're awesome at explaining UART. Thank you!

  • @templocal
    @templocal Před 3 lety

    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!

  • @MrVecheater
    @MrVecheater Před 4 lety

    Finally an explanation with a real world example
    That helped a lot

  • @TheReegus
    @TheReegus Před měsícem

    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.

  • @marklee1209
    @marklee1209 Před 2 lety +1

    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!

  • @fatty-it-man
    @fatty-it-man Před 3 měsíci

    Great!! Simple and clear, without not unnecessary details!

  • @leonjones7120
    @leonjones7120 Před 4 lety

    great, simple to grasp, well done!

  • @VincentRiquer
    @VincentRiquer Před 4 lety +14

    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.

  • @user-mv2bw7lg8z
    @user-mv2bw7lg8z Před 28 dny

    Excellent intro. Thank you!

  • @HasithaSameeraNova
    @HasithaSameeraNova Před měsícem

    Thank you for this clear explanation ❤💯

  • @JStation3
    @JStation3 Před 6 lety

    Cool presentation man, I totally get it now. Well done!

  • @paramhansnabar7848
    @paramhansnabar7848 Před 2 lety

    O wow 😂😂. No seriously this is the best explanation about data transmission. Thanks for making this video

  • @mmustho7740
    @mmustho7740 Před 4 lety

    Very clear explanation. Thanks.

  • @grzesiek1x
    @grzesiek1x Před 2 lety +1

    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 ;)

  • @ahmadmu6503
    @ahmadmu6503 Před 6 lety +1

    Thanks, Great explanation.

  • @piethelderop8085
    @piethelderop8085 Před 3 lety

    super well explanation of this , clear and easy to understand. please continue with this :-)

  • @ahoorabagheri6857
    @ahoorabagheri6857 Před 4 lety

    WOW!!!
    It was amazing!
    Thank you so much

  • @mrtmrf5007
    @mrtmrf5007 Před 4 lety

    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

  • @felixgspandl
    @felixgspandl Před rokem

    Thx man you really helped me with my school presentation

  • @kortt
    @kortt Před 5 lety

    Great explanation, thanks!

  • @rkgki
    @rkgki Před 4 lety

    Thanks! Very well explained.

  • @Chris-on5bt
    @Chris-on5bt Před 2 lety

    Great video, Thank you!

  • @Middlemen101
    @Middlemen101 Před 6 lety +1

    Thank you for the education!

  • @josegonzalez-ro3se
    @josegonzalez-ro3se Před 3 lety

    Thanks man, it was very clear.

  • @kbcbala
    @kbcbala Před 3 lety

    Mate Awesome. Well done. Wonderful explanation for beginners.

  • @mirmos
    @mirmos Před 6 měsíci

    thanks a lot! this is a clear explanation ^^

  • @muhammed5402
    @muhammed5402 Před 10 měsíci

    Perfect explanation. thx

  • @chelsea028
    @chelsea028 Před 2 lety

    very clearly explained with example

  • @Balasubramanian-dy5fp
    @Balasubramanian-dy5fp Před 2 lety

    Awesome explanation!

  • @williamgraham8761
    @williamgraham8761 Před 4 lety

    Thanks, nice clear explanation. 😁

  • @darkseiddoom
    @darkseiddoom Před 3 lety

    Great explanation sir!

  • @digihz_data
    @digihz_data Před 3 lety

    Very well explained.

  • @NightmareCrab
    @NightmareCrab Před 4 lety +2

    I learned something, thanks.

  • @varghesecherian4491
    @varghesecherian4491 Před 5 lety

    very clear explanations.....

  • @jcpartri
    @jcpartri Před 2 lety

    I learned something today! :-)

  • @Bianchi77
    @Bianchi77 Před 10 měsíci

    Nice info, well done, thanks for sharing it:)

  • @ulysses_grant
    @ulysses_grant Před 2 lety

    Left-handed people explains it better. Cheers ma lad!

  • @cemsarl5746
    @cemsarl5746 Před 3 lety

    Amazing explanation

  • @adampaech2469
    @adampaech2469 Před rokem

    Very good video, thanks

  • @PieterDaarth
    @PieterDaarth Před 3 lety

    Good Job! Many Thanks.

  • @danielgoodman3578
    @danielgoodman3578 Před rokem

    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.

  • @louisparisi1
    @louisparisi1 Před 2 lety

    Great vid, thanks

  • @alexnoggle1874
    @alexnoggle1874 Před rokem

    loved this video

  • @kumar_kiran
    @kumar_kiran Před 5 lety +8

    Can you also make similar video explaining SPI, I2C as well?

  • @azwara.9821
    @azwara.9821 Před 5 lety +2

    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?

  • @hslimsteven1
    @hslimsteven1 Před 4 lety

    Very good tutorial video.

  • @tjnguyen746
    @tjnguyen746 Před 3 lety

    Thanks. Please for good
    explaination !

  • @iamshivaramakrishna
    @iamshivaramakrishna Před 10 měsíci

    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.

  • @haksgayashan6264
    @haksgayashan6264 Před 5 lety +4

    Would you plz tell me how did you give the message to the arduino..? I'll be more helpful to understand that clearly..

  • @bassome3000ify
    @bassome3000ify Před 6 lety +3

    Thank you very much! Subscribed for clear explanations :DD

  • @ceilingwalker1
    @ceilingwalker1 Před 3 měsíci

    Very Nice!!!!! Thank you

  • @ycombinator765
    @ycombinator765 Před rokem

    exceptionally simple

  • @tonypitsacota2513
    @tonypitsacota2513 Před 9 měsíci

    Can you recommend your 1102? I am shopping for scopes now and it seems to be popular.

  • @justinc2633
    @justinc2633 Před 5 měsíci

    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?

  • @TT-ud5gf
    @TT-ud5gf Před 2 lety

    super clear!

  • @jimhinkle7245
    @jimhinkle7245 Před 3 lety

    Thank you!

  • @everybodyisdyingaminext5675

    very good...keep going

  • @Eduard_Kolesnikov
    @Eduard_Kolesnikov Před 9 měsíci

    Thank you man

  • @Galakyllz
    @Galakyllz Před 2 lety +1

    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.

  • @taghreedkhb7
    @taghreedkhb7 Před 2 lety

    thank you so much

  • @lozD83
    @lozD83 Před 3 lety +6

    Meanwhile on The Discovery Channel: "How to know when it's time to blow your nose" 😉

  • @Slipping_thru_the_Seams

    thank you!

  • @agustinothadeus
    @agustinothadeus Před 5 lety

    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?

    • @continuousload3963
      @continuousload3963  Před 5 lety

      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?

    • @travelimmortal
      @travelimmortal Před 5 lety

      Hi there , are you sure you have connected only TX & GND and not TX+RX & GND ?

  • @polishhammer1992
    @polishhammer1992 Před 4 lety

    While what you did explain made sense and was clear I wish a brief rundown of how you sent the bits took place.

  • @mayandiraja3862
    @mayandiraja3862 Před 3 lety

    Really nice vide

  • @oncom81
    @oncom81 Před 3 lety

    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...

  • @chennakrishna6377
    @chennakrishna6377 Před 6 lety +2

    Thanks. Really good explanation. Small question, How much time it takes to transmit the first bit after the start (falling edge)?

    • @continuousload3963
      @continuousload3963  Před 6 lety +4

      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?

    • @chennakrishna6377
      @chennakrishna6377 Před 6 lety +1

      Continuous Load . Yes. Thank you very much.

  • @ameiliaw8191
    @ameiliaw8191 Před 2 lety

    Thank You

  • @chelsea028
    @chelsea028 Před 2 lety

    beautiful

  • @ShivamKumar-ky6vm
    @ShivamKumar-ky6vm Před 2 lety

    AWEOME LECTURE

  • @MatthewSuffidy
    @MatthewSuffidy Před rokem

    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.

  • @jacobgarby199
    @jacobgarby199 Před 5 lety +14

    How does the receiver know that the end condition is the end condition, instead of a whole load of 1's?

    • @erblinas4423
      @erblinas4423 Před 5 lety +11

      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.

    • @4wheeldrifting
      @4wheeldrifting Před 3 lety

      @@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?

    • @mohamadwahba420
      @mohamadwahba420 Před 3 lety

      @@4wheeldrifting the start bit is the intial sync and the end bit is responsible for the delay between bytes

    • @madeforeverything_2701
      @madeforeverything_2701 Před 3 lety

      @@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...

  • @wesamsalih9020
    @wesamsalih9020 Před 5 lety

    very nice thanks

  • @paulkarkarin466
    @paulkarkarin466 Před 2 lety

    Спасибо. Понятно, интересно.

  • @abhijith1605
    @abhijith1605 Před 6 lety +1

    thanks a lot !

  • @AaronWerner
    @AaronWerner Před 16 dny

    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?

  • @johnjoyce
    @johnjoyce Před 5 lety +1

    Really good overall. Better audio, better lighting and more practice would make this a great classroom lecture even.

    • @continuousload3963
      @continuousload3963  Před 5 lety

      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?

    • @jvsnyc
      @jvsnyc Před 5 lety

      @@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.

  • @ranellabjata5170
    @ranellabjata5170 Před 2 lety

    Thanks sir

  • @juststupid
    @juststupid Před 6 lety

    Helpful

  • @scimad
    @scimad Před 5 lety +192

    Play at 1.25x speed and no thanks needed.

  • @sagarkokate619
    @sagarkokate619 Před 6 lety +2

    Whats the use of clock pule in uart and the receiver,and how it helps to transfer the data ?? please explain that ..

    • @continuousload3963
      @continuousload3963  Před 6 lety +8

      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.

    • @dexteraparicio7418
      @dexteraparicio7418 Před 5 lety +1

      @@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 ?

    • @continuousload3963
      @continuousload3963  Před 5 lety +2

      @@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 :)

  • @darieh4909
    @darieh4909 Před 2 lety

    thanks !

  • @mrtmrf5007
    @mrtmrf5007 Před 4 lety +2

    i had a question if i send a long string "this is a demo", does it still sent binary from the end of sentence ?

    • @shadowhalo123
      @shadowhalo123 Před 4 lety

      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

  • @cessromer7078
    @cessromer7078 Před 2 lety

    I would like to know the source code you wrote in arduino IDE ?

  • @belleluze
    @belleluze Před 3 lety +1

    9:16 4 cycles would be 1÷9600 = 104uS this would be one bit every 104uS? Is this correct?

  • @Thomas-bs2em
    @Thomas-bs2em Před rokem

    Great explanation! Can you please publish the code that your Arduino is running for this demo? THX!

  • @WistrelChianti
    @WistrelChianti Před 3 lety

    What happens if there is a 1 on the far left? How to tell the difference between that and the usual "no data" state?

  • @s-max3277
    @s-max3277 Před rokem

    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👍

  • @pdeepakjayan5515
    @pdeepakjayan5515 Před 8 měsíci

    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