What is a UART in an FPGA? Basics of Serial Ports, COM Port, RS-232, RS-485

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ค. 2024
  • NEW! Buy my book, the best FPGA book for beginners: nandland.com/book-getting-sta...
    Learn the basics of UARTs for use in FPGA. Introduction to baud rates, parity, full vs. half duplex, etc. All important concepts for how you can get your UART in your FPGA up and running. Tutorial for beginners.
    Support me on Patreon!
    / nandland
    Want to build your own UART on an FPGA? Grab a Go Board today! www.nandland.com/goboard/intr...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 64

  • @Aemilindore
    @Aemilindore 4 ปีที่แล้ว

    OH my god another video! This is such a lovely topic. So timely for me! I really love your basics videos. You simplify FPGA implementation sio much with giving us code examples. Doing a UART engine in the FPGA is just so great.

  • @Factory400
    @Factory400 4 ปีที่แล้ว +1

    I go my Go Board! Excellent practical intro into FPGA concepts. Thanks Russell.

  • @sumitkavathekar
    @sumitkavathekar 4 ปีที่แล้ว +3

    Please do these videos more frequently! We just wait for it

  • @sumitkavathekar
    @sumitkavathekar 4 ปีที่แล้ว

    That's really great @russel ! Thank you for such videos !

  • @plastilinovbly
    @plastilinovbly 2 ปีที่แล้ว

    Thank you for your content, it is really high quality!

  • @dave_dennis
    @dave_dennis 4 ปีที่แล้ว

    Looking forward to seeing the code behind this! I have a need to implement a UART and was just about to tackle that. It will be much easier to have someone explain me throught it. Thanks!

  • @boonedockjourneyman7979
    @boonedockjourneyman7979 4 ปีที่แล้ว

    Great stuff. Hang in there while the Patreon builds.

  • @triangleenjoyer
    @triangleenjoyer 4 ปีที่แล้ว +1

    Great video, thanks!

  • @spacedock873
    @spacedock873 4 ปีที่แล้ว +10

    FYI - Asynchronous does NOT mean that there are no clocks, just that a synchronous clock is not shared between the parties. The clocks are separate and internal to each UART and the start bit is there to align these clocks to the bitstream. Flow control is/was provided to cater for devices such as line printers and teletypes that could not process the data as quickly as it was received due to slow mechanisms and small or non-existent buffers. The flow control allowed the receiver to tell the transmitter to pause until it was ready to process more data.

  • @brockfg
    @brockfg 4 ปีที่แล้ว +1

    Youre back! 🤗

  • @sriganeshduraikannu7364
    @sriganeshduraikannu7364 4 ปีที่แล้ว

    Thank for Coming back to youtube. Please make more videos like this. Can you make a video on some complex interfaces like Ethernet, USB or PCIe?

  • @ninoporcino5790
    @ninoporcino5790 3 ปีที่แล้ว

    Some time ago I wrote a decoder for a cassette tape format, the old "Kansas City Standard" from the '70s... it's 600 baud, 8 bits, parity even, 2 stop bits. I had to decode it exactly the way you described, looking for the start bit negative edge, the jumping on the middle of the bit for sampling. The stop bit can be any length, not just two stop bits, because the data is asynchrounous. Back to the teletype days when the data was generated from typing on the keyboard.

  • @Hevletica
    @Hevletica 3 ปีที่แล้ว

    Excellent

  • @shri1527
    @shri1527 4 ปีที่แล้ว +3

    That's great video ... pls make such videos each week if possible. can you make a video related to Network On Chip along with different network topologies and its implementation on FPGA....pls

  • @robertocannella1881
    @robertocannella1881 ปีที่แล้ว

    Hi, Great Video! Is there a video detailing the coding?

  • @tuankietdang7285
    @tuankietdang7285 4 ปีที่แล้ว

    Thank you for the great videos. I have learnt a lot from your website and youtube channel. I’m gonna graduate in 2020, and in the future I want to be a professional in FPGA. so, what do you think is the best way to learn FPGA professionally? Should I pursuit a master degree?

  • @Monotoba
    @Monotoba 2 ปีที่แล้ว +1

    7 bits were used on old teletypes and video terminals. A lot of early serial devices also used 7 data bits. If speed counted, the time used to send that one bit at 110 Baud was an issue. Also, the early character encodings also used 7 bits. So only 7 bits were needed for a teletype or similar character-oriented devices. I restored a paper tape reader in the 90s that used 7 bit encoding and 7 bits data at a rate of 300 baud.

  • @hungry_devs
    @hungry_devs 8 หลายเดือนก่อน +1

    Can you recommend any books for me to find more information please?

  • @gurkiransb
    @gurkiransb 4 ปีที่แล้ว

    You could have typed some word and asked us to guess what it is based on the ASCII values displayed :p
    Great video btw. Appreciate your efforts. To the point and simple explanations.
    -(I'm just a random person trying to explore more of concepts like FPGA, Logic Gates, etc. and who stumbled upon your channel over a couple of years ago)

  • @zeeshanrafique2980
    @zeeshanrafique2980 4 ปีที่แล้ว +1

    please upload a video, which tells that how can we see our fpga output on serial monitor

  • @abdullahsaid5353
    @abdullahsaid5353 4 ปีที่แล้ว

    please upload a video on configurable baud rate in verilog

  • @Billiegoose
    @Billiegoose 4 ปีที่แล้ว +1

    Oh my gosh, I wish I knew/remembered there was a UART on the Go Board! I wrote a whole Go program for a Raspberry Pi to convert USB keyboard events into a SPI and used your SPI Master code to read them lol.

    • @Nandland
      @Nandland  4 ปีที่แล้ว +1

      Ha oh my that's quite the workaround!

    • @Billiegoose
      @Billiegoose 4 ปีที่แล้ว

      @@Nandland I'll have to show you what I'm building sometime! I used the SPI master to interface with a SSD1306 OLED display, and yesterday I got the go board to play simple audio using square waves.

    • @Nandland
      @Nandland  4 ปีที่แล้ว

      @@Billiegoose Yes I'm definitely interested!

  • @baghdadiabdellatif1581
    @baghdadiabdellatif1581 ปีที่แล้ว

    Thank you
    Can you send commands ligne with tera term if connected to ms dos pc not to Arduino?

  • @jasoncrawford1489
    @jasoncrawford1489 3 ปีที่แล้ว

    It's just two wires, but both ends need to agree on what the ground voltage is, right?

  • @ChrisDreher
    @ChrisDreher 4 ปีที่แล้ว +1

    Overall good intro to UARTs. Thanks.
    One thing to mention: parity comes in several flavors. When someone says that their serial port is set up as "9600, 8N1" the N stands for no parity. Other options include O for odd parity and E for even parity. Some obscure setups even use 1 or 0 parity, which just means that the parity bit is hardcoded to a value or 1 or 0 (not a very useful setting).

  • @yapandasoftware
    @yapandasoftware 4 ปีที่แล้ว

    I'm an engineer here in the UAE developing a custom BMS. I'm using Atomic Pi's connected to a USB hub and creating virtual Serial ports which communicate to my RS232/485 and one MCU. The touch screens use COM1 and the MCU uses COM4. The COM1 and COM4 seem to be symbiotic but when I plug in the DTU, it takes up COM6. I wrote the interface code in C++ and the COMs seem to work perfectly when the USB Hub isn't connected. But once the MCU and DTU are plugged into the system, I noticed sometimes when I send a command out the DTU, it messes with the MCU. Is it possible there is a cross in the RX/TX bus in the USB hub? I don't know if it uses an FTDI chip and Maxim RS232 or not. IT seems the handshake is happening between the MCU COM4 and DTU COM6. I don't know enough about USB hubs but I was hoping you might shed some light on what's happening. Every USB Hub from the same company is doing the same thing on all the CPU's.

  • @LLDevLab
    @LLDevLab 4 ปีที่แล้ว

    Thank you for great video :) Just couple weeks ago created own UART implementation on FPGA (just for fun). Noticed, that data bits can be 5 - 8 bits. This feels strange for me as well, why someone would send less then 8 bits at once...

    • @dangoswick
      @dangoswick 4 ปีที่แล้ว +1

      ASCII is 7 bit

  • @funinsun6925
    @funinsun6925 4 ปีที่แล้ว

    great job man can u send me the slides that u have

  • @s-max3277
    @s-max3277 ปีที่แล้ว

    Hello sir we have one question for you. Hare you online?
    Thank s

  • @niklaswallin9478
    @niklaswallin9478 4 ปีที่แล้ว

    @11:00 wrong, while it might do that, a serious reciever will sample it multiple times..

  • @ScottLahteine
    @ScottLahteine 4 ปีที่แล้ว +1

    9:40 - If there is no STOP bit, how is it guaranteed to have a falling edge on the START bit?

    • @Nandland
      @Nandland  4 ปีที่แล้ว +1

      Good question.. I've only ever seen interfaces with one stop bit. I don't think no stop bit is used in practice due to the reason you described.

    • @y_x2
      @y_x2 หลายเดือนก่อน

      He is in error there is always 1 stop bit, you may also have 1.5 or 2 bits. A FPGA does not have RS232 Buffers!

  • @mikerob6816
    @mikerob6816 4 ปีที่แล้ว

    UART for President

  • @trhosking
    @trhosking 3 ปีที่แล้ว

    7 data bits was frequently used when baud rates were significantly lower than your blisteringly fast 9600 baud. Remember that ASCII is at heart a 7 bit code, so why waste precious bandwidth on an unused bit? RS-232 allows 5, 6, 7 or 8 data bits. Yes, I said 5! Look up Baudot Code, which was used in telegraph systems. It used only 5 bits achieved using a shift between letters and numbers.
    Another sneaky way to maximise bandwidth was by using split baud rates. An example of this was the Videotex terminal which used 1200/75 baud. The bulk of the bandwidth was downstream to the terminal. As humans don’t type as fast as computers, the upstream was only 75 baud.
    Flow control is nothing to do with arbitrating who is using the line. It’s about preventing buffer overruns. Hardware flow control uses the RTS (Request to send) and CTS (Clear to send) wires on the RS-232 interface. Software flow control uses the XOn/DC1/Ctrl-S and XOff/DC3/Ctrl-Q ASCII characters. You can still type those codes in a terminal window to pause and resume fast scrolling output. Imagine for a moment that your terminal is connected via a serial link such as a modem, typing Ctrl-Q is sending an XOff to the remote telling it to stop sending as your mental buffer can’t keep up and is about to overflow. You can then send an XOn to resume.
    You kids just don’t know how good you have it.

  • @bobwmcgrath
    @bobwmcgrath 4 ปีที่แล้ว

    How are you getting tera term to send characters without hitting enter?

    • @Nandland
      @Nandland  4 ปีที่แล้ว

      All characters are sent immediately when the key is hit. There's no "buffer" that enter sends along.

  • @NivagSwerdna
    @NivagSwerdna 4 ปีที่แล้ว

    wot no code?

  • @phillipneal8194
    @phillipneal8194 4 ปีที่แล้ว +1

    If there is no clock driving the uart_rx and uart_tx then how do I compute something on a byte received and send the result back on uart_tx ?

    • @dhineshkumarc1
      @dhineshkumarc1 4 ปีที่แล้ว

      Even i have this doubt when i start to watch the video. My strong believe that any communication protocol don't run without clock.

    • @phillipneal8194
      @phillipneal8194 4 ปีที่แล้ว +2

      @@dhineshkumarc1 The clock is used to count off ticks. 217 ticks on a 25 mhz clock // (25000000)/(115200) = 217. The Nandland code for UART_RX and UART_TX is great. But when I try to call a RX->do something with the byte->UART_TX , the 'do something with the byte' becomes difficult for me.

    • @Naitik_Sanas
      @Naitik_Sanas 4 ปีที่แล้ว +2

      UART module do use clock to generate baud rate and to run internal state machine. only the RX, TX signals are who are not driven respect to the clock.

    • @phillipneal8194
      @phillipneal8194 4 ปีที่แล้ว

      @@Naitik_Sanas I have had some success manipulating the byte of data inside the FSM of UART_RX. Maybe I need to shift my thinking a bit (learn something --oh no !) because I would like to use the UART_RX/TX procedures inside my own FSM not have my FSM inside the UART_RX/TX FSM.

    • @Naitik_Sanas
      @Naitik_Sanas 4 ปีที่แล้ว

      @@phillipneal8194 your own FSM means i can assume you custom logic or algorithm that does operation on received data Right?
      if true then it is easy to check status signal like "ready" means data is ready on UART module to get Valid data then doing whatever is required on that given byte!

  • @y_x2
    @y_x2 หลายเดือนก่อน

    A FPGA does not have the RS232 voltage buffer!

  • @rycka88
    @rycka88 4 ปีที่แล้ว

    Thank you, now I know what is this think you humans call "keyboard".

  • @magnuswootton6181
    @magnuswootton6181 2 ปีที่แล้ว

    why do you even need a uart module if its this simple, a wire would do.

  • @briancannard7335
    @briancannard7335 2 ปีที่แล้ว

    ASCII came from 1963

  • @dukenuke2690
    @dukenuke2690 4 ปีที่แล้ว

    not like todays kids :_D

  • @andruha1067
    @andruha1067 4 ปีที่แล้ว +1

    Not a good video for educational purposes. Very shallow explanation and not enough depth of knowledge on the subject. Also, very biased and opinionated description on the topic. Just because you don't use something does not mean it's not important.

  • @ezioauditore2425
    @ezioauditore2425 4 ปีที่แล้ว

    U r Lazy and skip many topic😥