Flow Control for UART Serial communication between Z80 Playground and a PC

  Рет қаралды 4,191

John Squires

3 жыл бұрын

I found that with no flow-control between the Z80 playground and my PC I was losing characters when pasting from the PC console. I have investigated how to turn on flowcontrol and make sure that no data is lost in either direction of serial transfer. My UART is a 16550 (16C500) IC and my USB to Serial converter is a CH340 module.

Пікірлер: 32
@kwgm8578
@kwgm8578 2 жыл бұрын
You're doing a great service for the EE community. I'm a retired computer engineer and used to get paid good money to debug serial I/O. They just don't teach 1980s technology in today's engineering programs, but there are still plenty of devices in various industries that speak only RS-232/RS-422. I would advise anyone interested in this stuff to look for used books on Serial Communications using PCs or Microprocessors. There were a couple of good ones published in the 1980s and early 1990s. If you have EE training or experience working at the breadboard level, the data sheets for these older chips also provide excellent guidance for working. with these chips with descriptions, example schematics, and driver primitives written in pseudo code. Have fun!
@stupossibleify
@stupossibleify 3 жыл бұрын
Waiting for more Z80 Playgrounds. No pressure ;)
@rohandvivedi
@rohandvivedi 3 жыл бұрын
Thanks, I was searching for material to do the exact same thing. this video helped me.
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Hope your project works out!
@grhmsmth
@grhmsmth 3 жыл бұрын
It's worth having a read of the Wikipedia article on RTS/CTS which you can find here: en.wikipedia.org/wiki/RS-232#RTS,_CTS,_and_RTR RTS/CTS was originally Request To Send / Clear To Send and was used in old half duplex modems where the terminal was normally listening to data coming from the modem and had to ask if it wanted to send data to the modem and then had to wait for the modem to say it could send. (Think of how a walkie talkie works, you normally listen and have to push a button if you want to talk). In modern circuits (which are full duplex) a new signal has been defined called RTR (Ready to Receive) which is assigned the same pin as the old RTS signal. It indicates that the receiver is ready to receive and is connected to the Clear to Send signal of the sender and the circuit then works as you'd expect - unfortunately many devices still call the RTR signal RTS even though it has a different purpose!
@grhmsmth
@grhmsmth 3 жыл бұрын
Just had a read of the data sheet for the 16C550B UART and it describes the RTS pin as "When active, RTS informs the modem or data set that the UART is ready to receive data". Note the "ready to receive" phrase, this pin should really be called RTR!!
@wayland7150
@wayland7150 Жыл бұрын
I used the RTS line to turn on the transmit signal on an RS485 interface. The problem was in Windows it could not quite turn it on fast enough so I ended up using a 555 timer to turn transmit on when it saw the start bit on the TX line.
@wayland7150
@wayland7150 Жыл бұрын
@@grhmsmth Terribly confusing wording for these signals.
@albertpauw8234
@albertpauw8234 3 жыл бұрын
Hi John, good find! You're making good progress. Stay safe, regards Albert
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Thanks!
@stevesm2010
@stevesm2010 3 жыл бұрын
Nice catch :-)
@Decco6306
@Decco6306 3 жыл бұрын
very cool
@simonescaravati7218
@simonescaravati7218 3 жыл бұрын
THANKS!! I had the same problem, you are my savior
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Frustrating eh?
@simonescaravati7218
@simonescaravati7218 3 жыл бұрын
@@CircuitBreaker256 my god yes... fortunately i'm payed for being frustrated ahah
@semibiotic
@semibiotic 2 жыл бұрын
There is third, quick and dirty solution for paste issue when flow control is not available - delay between sent characters. Some terminal programs have such option. That allow to paste without extra wirings and/or settings, but sacrifices transfer time.
@wayland7150
@wayland7150 Жыл бұрын
The UART should be raising an interrupt when it's buffer has some data in it. That way you'd read it in time. Using RTS means the UART is saying hold on my CPU is having a tea break.
@clangerbasher
@clangerbasher 3 жыл бұрын
Did I see the magic words 'Jupiter Ace'?
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Yes, they are magic for me too. I'm working on a "Poor-Man's-Jupiter-Ace" project right now!
@matthewpeterson5159
@matthewpeterson5159 3 жыл бұрын
I have the Z80 Playground v1.2 and I can't seem to get flow control working. I set the `FLOW` option to `01` and have enabled RTS/CTS flow control on my PC, but "the paste test" still fails. I suspect it's an issue on my end, but I don't have any idea. I am on Linux; I have been using minicom, which has an option for hardware flow control. I also tried using screen and was able to confirm with that (as well with stty) that RTS/CTS flow control is enabled. Any ideas?
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Strange you should mention that because I have found exactly the same problem. It worked a couple of months ago, as you see in one of my videos, but now I can't get it to work. I will have to look into it. Slowing down the baud rate will help, as will telling TeraTerm to delay each character it sends, but really the flow control option is the proper solution.
@aboothahiru6354
@aboothahiru6354 3 жыл бұрын
Can we connect uart cable to my Qualcomm snapdragon( soc sdm636) motherboard to debug kernel log , how to find the rx tx gnd on the motherboard or is there any alternative way to connect through USB port with an FTDI adaptor ??
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Sorry I do not know!
@mike94560
@mike94560 2 жыл бұрын
The speed limit is really in the connection speed. Then the two systems involved are like cars. One is so slow it can't even reach the speed limit except for bursts when going downhill. The other car is so fast it ca easily hit the speed limit. You can try lowering the speed limit and see if the slow car can keep up. But obviously flow control is the better solution.
@wayland7150
@wayland7150 Жыл бұрын
The Z80 should be able to handle it. He's not using interrupts I suspect.
3 жыл бұрын
English without flow control feels like Dutch, just noticed ;)
@SlyEcho
@SlyEcho 3 жыл бұрын
3:12 You have some liquid nitrogen setup for your 7 GHz PC? lol
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
Haha I think I got carried away boasting about the speed of my PC. Maybe three point seven?
@SlyEcho
@SlyEcho 3 жыл бұрын
@@CircuitBreaker256 It's good to make videos so that they will be relevant in 10 year's time ;)
@stephenwong9723
@stephenwong9723 3 жыл бұрын
Did you record in a cathedral?
@CircuitBreaker256
@CircuitBreaker256 3 жыл бұрын
A chapel! Seriously! I won't do it again!
@stephenwong9723
@stephenwong9723 3 жыл бұрын
@@CircuitBreaker256 Praise Lord!
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 56 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,6 МЛН
Looks very comfortable. #leddisplay #ledscreen #ledwall #eagerled
0:19
LED Screen Factory-EagerLED
Рет қаралды 6 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 1,2 МЛН
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 12 МЛН
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 17 МЛН