No video

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

  Рет қаралды 2,974

Anders Nielsen

Anders Nielsen

9 ай бұрын

How do you control serial besides TX and RX? That's what I try to explain in this video featuring a Raspberry Pi Zero W, a USB to Serial FTDI232 dongle and my very own 6502 Single Board Computer - the 65uino.
Guest starring: An 8 channel logic analyzer.
Free Discord Clubhouse: / discord
Let's chat about what you like best about old chips, electronics, breadboards and hacking all sorts of things!
Join this channel to get access to perks that let you see videos early and make you stand out in comments.
/ @andersnielsenaa
Check out the whole series (playlist): • 6502 Computer
Mentions:
en.wikipedia.o...)
en.wikipedia.o...
en.wikipedia.o...
The device tree overlay files I used are here:
github.com/Hia...

Пікірлер: 16
@AndersNielsenAA
@AndersNielsenAA 9 ай бұрын
Leave a comment and come say hi on Discord - I promise nobody bites: discord.gg/kmhbxAjQc3 :)
@GregCoonrod
@GregCoonrod 9 ай бұрын
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 9 ай бұрын
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 :)
@derekchristenson5711
@derekchristenson5711 6 ай бұрын
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 6 ай бұрын
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 :)
@GregStrike
@GregStrike 9 ай бұрын
Hey Anders, GREAT explanation of flow control. Keep it up man!
@ScienceReasonLove
@ScienceReasonLove 9 ай бұрын
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 9 ай бұрын
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.
@melkiorwiseman5234
@melkiorwiseman5234 9 ай бұрын
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 9 ай бұрын
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 9 ай бұрын
@@AndersNielsenAA Yeah, I got confused. The receiver requests sending, and the transmitter checks that it's clear to send. I have to remember that.
@giova2927
@giova2927 9 ай бұрын
Hi I would send gcode from esp32 to an old CNC could you help me? My friend said me this CTS control
@AndersNielsenAA
@AndersNielsenAA 9 ай бұрын
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 9 ай бұрын
@@AndersNielsenAA we should talk another place. It's a sigma vc1000
@AndersNielsenAA
@AndersNielsenAA 9 ай бұрын
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 9 ай бұрын
@@AndersNielsenAA ok thanks I'm writing there
I gave away 35 8-bit motherboards
10:32
Anders Nielsen
Рет қаралды 2,4 М.
Serial Bootloader for ANY 6502 Single Board Computer #65uino
28:38
Anders Nielsen
Рет қаралды 2,7 М.
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 48 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 126 МЛН
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 97 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 36 МЛН
RS232 interface with the 6551 UART
22:45
Ben Eater
Рет қаралды 202 М.
DIY XXL Breadboard (with XNL Breadboard I/O)
11:06
XNL Future Technologies
Рет қаралды 7 М.
Can a 6502 computer control a Raspberry Pi?
41:26
Anders Nielsen
Рет қаралды 1,4 М.
Hacking ROMs for fun and profit!
9:02
Anders Nielsen
Рет қаралды 3,5 М.
Intro to Hardware Reversing: Finding a UART and getting a shell
12:07
Tony Gambacorta
Рет қаралды 887 М.
This $9 Universal ROM Burner is Open Source!
16:36
Anders Nielsen
Рет қаралды 34 М.
Finding UART and Getting a Root Shell on a Linux Router
20:11
Matt Brown
Рет қаралды 33 М.
Programming old ROMs with HIGH voltage
13:57
Anders Nielsen
Рет қаралды 1,9 М.
Easy Serial RTS/CTS Handshake - Minimal CPU #12
7:45
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 48 МЛН