Serial Flow Control. What's CTS RTS XOFF XON and why should you care?

Поділитися
Вставка
  • Опубліковано 28 січ 2025

КОМЕНТАРІ • 18

  • @AndersNielsenAA
    @AndersNielsenAA  Рік тому

    Leave a comment and come say hi on Discord - I promise nobody bites: discord.gg/kmhbxAjQc3 :)

  • @GregCoonrod
    @GregCoonrod Рік тому +2

    It is so cool to see this working with minimal (if annoying) changes to the Pi! Thanks for taking the time to explore this topic. I will be leaning on your work for my own 6502 SBC.

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому +2

      I certainly thought it was worth covering a little bit - it’s easy to overlook when you learn the RX/TX basics and don’t need flow control until much later :)

  • @GregStrike
    @GregStrike Рік тому

    Hey Anders, GREAT explanation of flow control. Keep it up man!

  • @derekchristenson5711
    @derekchristenson5711 Рік тому

    Neat! I'm often frustrated, while trying to get a serial connection (a "simple" serial connection) between two computers by how many different possibilities there are for flow control and no flow control, and the problems that arise when two computers both eschew flow control, but they still drop characters, showing that they clearly need it. It's interesting to see it implemented on your 65uino!

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому +1

      There's also matter of noise - doesn't take very long wires to make serial data into complete nonsense. But at least 9600 baud is rather forgiving :)

  • @ScienceReasonLove
    @ScienceReasonLove Рік тому

    For the kernel boot messages: check the kernel command line. The documentation says that the console=ttyS0 line takes flow control information from the second passed parameter. So to have ttyS0 be configured for RTS/CTS flow control at 9600 baud with no parity you’d have this: console=ttyS0,9600n0r

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому +1

      That part is actually in the video :) For the kernel in Raspbian though, that part doesn't seem to be compiled in, so console=ttyAMA0,4800n8r only sets 4800 baud, no parity and 8 bits ... but doesn't make it respect CTS.

  • @giova2927
    @giova2927 Рік тому

    Hi I would send gcode from esp32 to an old CNC could you help me? My friend said me this CTS control

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому

      If it's a really old CNC router you might need RS-232 (+-10V signal levels). Hard to say without knowing anything about the device :)

    • @giova2927
      @giova2927 Рік тому

      @@AndersNielsenAA we should talk another place. It's a sigma vc1000

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому

      You’re welcome to come hang out on Discord and ask in the #project-help channel - it doesn’t sound like I’ll be of much help though

    • @giova2927
      @giova2927 Рік тому

      @@AndersNielsenAA ok thanks I'm writing there

  • @melkiorwiseman5234
    @melkiorwiseman5234 Рік тому

    Short version of how RS-232C flow control is supposed to work: If XOFF/XON flow control is used, the transmitter is supposed to monitor incoming bytes and if an XOFF byte is received, the transmitter side should pause transmission and wait for an XON byte to be received before continuing sending. If CTS/RTS flow control is used, then the transmitter is supposed to check RTS before sending each byte and wait for RTS to be enabled before transmitting the byte.
    Unfortunately, the advent of very fast CPUs has caused many programmers even at the system level to just assume that the receiver can handle whatever speed has been selected and so the transmitter programs often do not implement any form of flow control. This is a very common but very poor practice and illustrates how common "lazy programming" has become.

    • @AndersNielsenAA
      @AndersNielsenAA  Рік тому

      Yup. But note the transmitter should check (its) CTS - not RTS.
      I hope the correct meaning came across in the video even if I misnamed RTS as CTS in the 6502 code.

    • @melkiorwiseman5234
      @melkiorwiseman5234 Рік тому

      @@AndersNielsenAA Yeah, I got confused. The receiver requests sending, and the transmitter checks that it's clear to send. I have to remember that.

  • @SandraClark-r8v
    @SandraClark-r8v 4 місяці тому

    Murazik Terrace

    • @AndersNielsenAA
      @AndersNielsenAA  4 місяці тому

      I'll assume that's a name - but I'm not sure you can tag people in UA-cam comments :)