Serial port confusion.

Nagging hardware related question? Post here!
mselkin
Bent Pin Expansion Port
Posts: 85
Joined: Mon Mar 01, 2021 11:49 am

Serial port confusion.

Post by mselkin »

Hi everyone,

I am sure this has been discussed before, but I am trying to understand the serial port pinouts.

I would like to make my own cable, where one end plugs into the QL serial 2 port (a QL BT connector) and the other end (a DB 9 connector), will plug into the serial port of a wifi modem emulator.
I am finding conflicting, confusing serial port information on the internet and when I look at various ready made serial cables on eBay, they often seem to be wired differently.

I have seen:

QL BT connector Modem DB9 serial port
1 5
2 3
3 2
4 4
5 8

or

QL BT connector Modem DB9 serial port
1 5
2 3
3 2
4 8
5 7

and sometimes 2 to 2 and 3 to 3, instead of crossed

Note, I am not trying to make a 'null modem cable' to connect the QL directly to a PC serial port, but rather simply a QL BT to DB9 converter, in other words, the DB9 side of my cable would be the QL's serial port as a DB9 connector, rather than a BT connector and I would still use a serial cable with DB9 on each side to go between my port converter to the modem.

I am a beginner hobbiest and any help to enhance my understanding and settle my confusion would be appreciated.

Mark


User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: Serial port confusion.

Post by Andrew »



mselkin
Bent Pin Expansion Port
Posts: 85
Joined: Mon Mar 01, 2021 11:49 am

Re: Serial port confusion.

Post by mselkin »

Thank you,

I have seen that diagram but I was of the understanding that those connections were specifically for a mouse, or am I wrong?


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Serial port confusion.

Post by NormanDunbar »

If you need to know anything about the QL, Dilwyn's site is the font of all knowledge. http://www.dilwyn.me.uk/docs.

If you need details of SuperBASIC, and almost all other toolkits, plus lots of other stuff, https://superbasic-manual.readthedocs.io/en/latest/.

We also have a Wiki at https://qlwiki.qlforum.co.uk/doku.php.

Enjoy, and welcome to the mad house!

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: Serial port confusion.

Post by Andrew »

mselkin wrote:I have seen that diagram but I was of the understanding that those connections were specifically for a mouse, or am I wrong?
Those connections convert QL serial port to DB9 - same pin layout as on PC.


mselkin
Bent Pin Expansion Port
Posts: 85
Joined: Mon Mar 01, 2021 11:49 am

Re: Serial port confusion.

Post by mselkin »

Thank you all for your replies.
I think I understand now.
Waiting for modem emulator to arrive and then will test the cable.


Derek_Stewart
Font of All Knowledge
Posts: 3929
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Serial port confusion.

Post by Derek_Stewart »

Hi,

What is the best SER2 to Simulant WIFI Modem?

I note on eBay, that a SER2 to DB9 cable is;

Code: Select all

SER2     DB9
1. GND    5. GND
2. TxD    3. TxD
3. RxD    2. RxD
4. DTR    4. DTR
5. CTS    6. CTS
6. 12v    9. RI
Maybe this changes should be made:

Code: Select all

SER2      DB9
1. GND    5. GND
2. TxD    3. TxD
3. RxD    2. RxD
4. DTR    4. CTS
5. CTS    6. RTS
6. 12v    9. RI
How about the 12v connected to the DB9 DTR


Regards,

Derek
Derek_Stewart
Font of All Knowledge
Posts: 3929
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Serial port confusion.

Post by Derek_Stewart »

Hi,

All sorted now, I forgot all about comms cable.

But looking at the QTPI documentation this defines what is required

Code: Select all

SER2     DB9
1. GND    5. GND
2. TxD    3. TxD
3. RxD    2. RxD
4. DTR    7. RTS
5. CTS    8. CTS
6. NC
note QL Pin 4 is actually a RTS rather than a DTR.

I connected this cable from a Trump Card QL with 8049 to Simulant Wifi Modem, which worked after setting Hayes register S54=2 which is DTR high.

Next step replace 8049 with Hermes.


Regards,

Derek
skullandbones
ROM Dongle
Posts: 4
Joined: Sun Mar 20, 2022 5:55 pm

Re: Serial port confusion.

Post by skullandbones »

Part of the confusion is due to the "RS-232" specifications changing over the last 60 odd years.

See https://en.wikipedia.org/wiki/RS-232

Note that there are also equivalent European specifications known as ITU-T V.24 and V.28. These specifications can be easier to understand than the American "RS-232" specifications.

There was a major change in 1997 that repurposed the RTS pin to mean "Ready to Receive" aka RTR.

In the 1980s and earlier, 9-pin D type connectors did not exist for "RS-232", instead 25-pin D types were used. But critically, the hardware flow control supported only one of the transmission lines and operated in a 3-way handshake between DTR, CTS and RTS. The QL was designed with this standard in mind and therefore DTR is valid.

In the 1990s, PC manufacturers started to add 9-pin D-types for "RS-232" but these were not codified into the "RS-232" specifications until 1997. These 9-pin D types use the logical RTR meaning for RTS to allow for full-duplex hardware flow control to be supported for both transmission lines. Unfortunately, the RTS pin was never relabelled to be RTR.

Even after 20 years of the specifications being released, people still say RTS is "Request to Send" which is not how it works as that is the old standards. If you think RTR, "Ready to Receive" then you get less confused about how the hardware flow control works. I even see software programmers today and hardware manufacturers continuing to use the defunct term "Request to Send". I guess few people use first principles and consult the actual 1997 specifications.

In conclusion, DTR can be used instead of RTS aka RTR because DTR indicates a readiness that the device is ready to receive.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Serial port confusion.

Post by tofro »

And a big part of the confusion has been caused by Sinclair themselves in that ser1_ and ser2_ are not the same.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply