Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.sinclair > #4845 > unrolled thread

RS232 - built-in versus Interface 1

Started byLee Osborne <losborne74@gmail.com>
First post2020-05-28 13:07 -0700
Last post2020-11-19 16:27 +0000
Articles 6 — 3 participants

Back to article view | Back to comp.sys.sinclair


Contents

  RS232 - built-in versus Interface 1 Lee Osborne <losborne74@gmail.com> - 2020-05-28 13:07 -0700
    Re: RS232 - built-in versus Interface 1 Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> - 2020-11-18 23:20 +0000
      Re: RS232 - built-in versus Interface 1 Volker Bartheld <news2020@bartheld.net> - 2020-11-19 14:26 +0100
        Re: RS232 - built-in versus Interface 1 Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> - 2020-11-19 15:38 +0000
          Re: RS232 - built-in versus Interface 1 Volker Bartheld <news2020@bartheld.net> - 2020-11-19 16:47 +0100
            Re: RS232 - built-in versus Interface 1 Russell Marks <zgedneil@spam^H^H^H^Hgmail.com> - 2020-11-19 16:27 +0000

#4845 — RS232 - built-in versus Interface 1

FromLee Osborne <losborne74@gmail.com>
Date2020-05-28 13:07 -0700
SubjectRS232 - built-in versus Interface 1
Message-ID<3af4e4ae-3587-400c-8358-e1e38a83bcae@googlegroups.com>
Hello all. After some advice, and I figured someone here would probably be able to help.

I'm the owner of a (grey case) Spectrum +2, and I'm keen to try communication with other devices via RS232. Obviously, the +2 has a built-in RS232 port, but as far as I can tell, it's not much good for two-way comms with other machines, and is of course hampered by the completely non-standard plug. I've used the port for printing via a QL serial-to-parallel cable, and it works fine for that, but I'm guessing it isn't great for anything else.

So...I also own an Interface 1, which I have hooked up to the most excellent vDriveZX. It would seem to be at least vaguely more standard than the built-in port, and supports different data formats from within BASIC, and seems to work in both directions rather better than the built-in port. I haven't done anything with it yet, but I do own a cable for connecting the IF1 to a serial printer, and I have a printer on the way.

If I want to play with sending data to and from a PC, and also other old crap I have lying around like my Amstrad NC100, is it best to use the built-in port or the IF1? Also, is the IF1 RS232 port useable in 128K mode? I've not been able to answer this, and it doesn't seem well-documented. Obviously the P channel is attached to stream 3, and in 48K mode drives the ZX printer, and in 128K mode goes to the RS232, so does that mean the T and B channels will correctly use the IF1 RS232 in 128K mode? I hope it does - or will I have to stick to 48K mode if I want to use the IF1 RS232?

Also, as I have the IF1 printer cable, which ends in a 25-pin male plug, is it possible to just get hold of one other cable that will let me connect direct to a PC? I don't have the skills or resources to wire up one of my own, so if anyone can tell me what spec of cable I need, or where I can get one, that would be really helpful.

My Interface 1 has the original ROM in it, if that makes any difference.

Any other hints and tips for connection to other machines? Like software for the Speccy? Am I insane for wondering if it's possible to convert text from the PC to Tasword files???

Hope that all makes sense.

Lee

[toc] | [next] | [standalone]


#4886

FromRussell Marks <zgedneil@spam^H^H^H^Hgmail.com>
Date2020-11-18 23:20 +0000
Message-ID<E_htH.49936$zz79.40162@usenetxs.com>
In reply to#4845
Lee Osborne <losborne74@gmail.com> wrote:

> Hello all. After some advice, and I figured someone here would
> probably be able to help.

This is hilariously late and probably pointless by now, but since I'm
already here why not. :-)

> I'm the owner of a (grey case) Spectrum +2, and I'm keen to try
> communication with other devices via RS232. Obviously, the +2 has a
> built-in RS232 port, but as far as I can tell, it's not much good for
> two-way comms with other machines, and is of course hampered by the
> completely non-standard plug. I've used the port for printing via a QL
> serial-to-parallel cable, and it works fine for that, but I'm guessing
> it isn't great for anything else.

It can be vaguely tolerable if you make sure you use RTS/CTS
handshaking, and your serial lead is properly wired. It's still pretty
bad though. I think I got my best results at 2400 baud.

> If I want to play with sending data to and from a PC, and also other
> old crap I have lying around like my Amstrad NC100, is it best to use
> the built-in port or the IF1? Also, is the IF1 RS232 port useable in

I seem to remember the IF1 port was very slow, but I could be wrong on
that. My hunch would be to go with the builtin one anyway.

> 128K mode? I've not been able to answer this, and it doesn't seem
> well-documented. Obviously the P channel is attached to stream 3, and
> in 48K mode drives the ZX printer, and in 128K mode goes to the RS232,
> so does that mean the T and B channels will correctly use the IF1
> RS232 in 128K mode? I hope it does - or will I have to stick to 48K
> mode if I want to use the IF1 RS232?

Given how it works my hunch would be 48k-only, but I'm not sure.

> Also, as I have the IF1 printer cable, which ends in a 25-pin male
> plug, is it possible to just get hold of one other cable that will let
> me connect direct to a PC?

I imagine this might be possible, but I doubt it's the best option.

> Any other hints and tips for connection to other machines? Like
> software for the Speccy? Am I insane for wondering if it's possible to
> convert text from the PC to Tasword files???

I think Tasword Two files (at least) were pretty much just a straight
dump of the 64-column ASCII text with no line breaks. So 64 chars for
one line, 64 for the next, and so on. I still have a few old Tasword
files from the 80s (originally from microdrive) and they all seem to
be like that.

-Rus.

[toc] | [prev] | [next] | [standalone]


#4887

FromVolker Bartheld <news2020@bartheld.net>
Date2020-11-19 14:26 +0100
Message-ID<10gh91uncbmkk.dlg@news.bartheld.net>
In reply to#4886
On Wed, 18 Nov 2020 23:20:04 GMT, Russell Marks wrote:
> Lee Osborne <losborne74@gmail.com> wrote:
>> I'm the owner of a (grey case) Spectrum +2, and I'm keen to try
>> communication with other devices via RS232. Obviously, the +2 has a
>> built-in RS232 port, but as far as I can tell, it's not much good for
>> two-way comms with other machines, and is of course hampered by the
>> completely non-standard plug.
> It can be vaguely tolerable if you make sure you use RTS/CTS
> handshaking, and your serial lead is properly wired. It's still pretty
> bad though. I think I got my best results at 2400 baud.

Interesting. So the IF-1 hard/software is that much different to what Sir
Clive and his folks have used for the +2 later? Hard to believe. For my
Microdrive transfers, I have used the IF-1 against an IBM Thinkpad T30
(with a _real_ RS232 port, not the USB-emulation) up to 19'200 baud, no
problem.

Details here: https://worldofspectrum.net/pub/sinclair/tools/pc/mdv2img.zip
, also includes how to fabricate a cable supporting RTS/CTS.

>> If I want to play with sending data to and from a PC, and also other
>> old crap I have lying around like my Amstrad NC100, is it best to use
>> the built-in port or the IF1?

Whatever works.

> I seem to remember the IF1 port was very slow

Well. The Z80 CPU runs at 3.5 MHz, there is no SIO available and the 16550
UART (with FIFO) was born years after the Spectrum. In that light, serial
communication via software...


0C5A	BCHAN-OUT	LD	B,+0B	Counts '11' bits.
0C5C		CPL		Invert the eight data bits.
0C5D		LD	C,A	C holds the byte to be sent.
0C5E		LD	A,(IOBORD)	Fetch new border colour.
0C61		OUT	(+FE),A	Change border colour.
0C63		LD	A,+EF	Reset CTS and select RS232.
0C65		OUT	(+EF),A
0C67		CPL
0C68		OUT	(+F7),A	Make RXdata have a low signal level.
0C6A		LD	HL,(BAUD)	Fetch timing constant.
0C6D		LD	D,H	Copy into DE register pair.
0C6E		LD	E,L
0C6F	BD-DEL-1	DEC	DE	Firstly wait (26*(BAUD)) T cycles.
0C70		LD	A,D
0C7l		OR	E
0C72		JR	NZ,0C6F,BD-DEL-1
0C74	TEST-DTR	LD	A,+7F	Read port +7FFE (SPACE key).
0C76		IN	A,(+FE)
0C78		OR	+FE	Read port +FEFE (CAPS SHIFT key) only
0C7A		IN	A,(+FE)	if SPACE is being pressed.
0C7C		RRA		Test bit 0.
0C7D		JP	NC,0CB4,BRK-INOUT	Give an error if BREAK is pressed.
0C80		IN	A,(+EF)	Read DTR line.
0C82		AND	+08	Only bit 3.
0C84		JR	Z,0C74,TEST-DTR	Jump back until DTR is found high.
0C86		SCF		Set carry flag (start bit).
0C87		DI		Disable interrupts.
0C88	SER-OUT-L	ADC	A+00	In fact, shift carry into bit 0 of
				accumulator.
0C8A		OUT	(+F7),A	Send this bit over RS232 link.
0C8C		LD	D,H	Copy timing constant into DE.
0C8D		LD	E,L
0C8E	BD-DEL-2	DEC	DE	Wait 26*(BAUD) T cycles after having
0C8F		LD	A,D	sent each bit.
0C90		OR	E
0C9l		JR	NZ,0C8E,BD-DEL-2
0C93		DEC	DE	Wait 6 T cycles.
0C94		XOR	A	Clear A for next pass.
0C95		SRL	C	Shift the bit to be sent into carry.
0C97		DJNZ	0C88,SER-OUT-L	Loop for all 11 bits.
0C99		DI		Enable interrupts.
0C9A		LD	A,+01
0C9C		LD	C,+EF
0C9E		LD	B,+EE
0CA0		OUT	(+F7),A	Make RXdata having a high level.
0CA2		OUT	(C),B	Turn off RS232.
0CA4	BD-DEL-3	DEC	HL	Insert a final delay before returning
0CA5		LD	A,L	via the border-restore routine
0CA6		OR	H	below.
0CA7		JR	NZ,0CA4,BD-DEL-3

... is as good as it probably gets (source code quote and comments courtesy
of Gianluca Carri's "Spectrum Shadow ROM Disassembly") up to 19'200 Baud.

>> Also, as I have the IF1 printer cable, which ends in a 25-pin male
>> plug, is it possible to just get hold of one other cable that will let
>> me connect direct to a PC?

Sure.

You'll have to download spxfr at
http://www.angelfire.com/games6/atari2600/spxfr/index.html
and solder the connection cable mentioned there. Basically you'll need a
female RS232 9-pin connector (PC) and a male RS232 9-pin connector
(Speccy) connected with a shielded 5-pin round cable as follows:

		PC    Speccy
	2 - RD	3 - TD
	3 - TD	2 - RD
	5 - GND	7 - GND (Shield)
	7 - RTS	4 - CTS
	8 - CTS	5 - RTS
	1 - DCD	9 - DTR
 
>> Am I insane for wondering if it's possible to convert text from the PC
>> to Tasword files???

I would rather do it the other way round (ZX->PC) but my Microdrive
cartridges are all rotten and it's quite hard to forensically
restructure/realign the errorneous sectors. Tasword accepts plain text with
hard formatting. IIRC it's not CR/LF but LF only. Just try it out.

> I think Tasword Two files (at least) were pretty much just a straight
> dump of the 64-column ASCII text with no line breaks. So 64 chars for
> one line, 64 for the next, and so on. I still have a few old Tasword
> files from the 80s (originally from microdrive) and they all seem to
> be like that.

Jup. The files on my tapes (still intact, sortof) were like that.

Volker

[toc] | [prev] | [next] | [standalone]


#4888

FromRussell Marks <zgedneil@spam^H^H^H^Hgmail.com>
Date2020-11-19 15:38 +0000
Message-ID<EjwtH.10590$oT47.7709@usenetxs.com>
In reply to#4887
Volker Bartheld <news2020@bartheld.net> wrote:

> On Wed, 18 Nov 2020 23:20:04 GMT, Russell Marks wrote:
>> Lee Osborne <losborne74@gmail.com> wrote:
>>> I'm the owner of a (grey case) Spectrum +2, and I'm keen to try
>>> communication with other devices via RS232. Obviously, the +2 has a
>>> built-in RS232 port, but as far as I can tell, it's not much good for
>>> two-way comms with other machines, and is of course hampered by the
>>> completely non-standard plug.
>> It can be vaguely tolerable if you make sure you use RTS/CTS
>> handshaking, and your serial lead is properly wired. It's still pretty
>> bad though. I think I got my best results at 2400 baud.
>
> Interesting. So the IF-1 hard/software is that much different to what Sir
> Clive and his folks have used for the +2 later?

Not necessarily, but the +2 was Amstrad after all. :-) I suppose I
could be misremembering, it's not like faster speeds are impossible.

>> I seem to remember the IF1 port was very slow
>
> Well. The Z80 CPU runs at 3.5 MHz, there is no SIO available and the 16550
> UART (with FIFO) was born years after the Spectrum. In that light, serial
> communication via software...

To be fair, I don't think I ever used the IF1 port - it's just the
impression I had at the time. I could have phrased that better.

-Rus.

[toc] | [prev] | [next] | [standalone]


#4889

FromVolker Bartheld <news2020@bartheld.net>
Date2020-11-19 16:47 +0100
Message-ID<1c0w91sg3z5mw$.dlg@news.bartheld.net>
In reply to#4888
On Thu, 19 Nov 2020 15:38:12 GMT, Russell Marks wrote:
> Volker Bartheld <news2020@bartheld.net> wrote:
>> On Wed, 18 Nov 2020 23:20:04 GMT, Russell Marks wrote:
>>> I seem to remember the IF1 port was very slow
>> Well. The Z80 CPU runs at 3.5 MHz, there is no SIO available and the 16550
>> UART (with FIFO) was born years after the Spectrum. In that light, serial
>> communication via software...
> To be fair, I don't think I ever used the IF1 port - it's just the
> impression I had at the time. I could have phrased that better.

Verdict: It's not USB3. Surprise, surprise. ;-)

Volker

[toc] | [prev] | [next] | [standalone]


#4890

FromRussell Marks <zgedneil@spam^H^H^H^Hgmail.com>
Date2020-11-19 16:27 +0000
Message-ID<b2xtH.6833$Cp69.2319@usenetxs.com>
In reply to#4889
Volker Bartheld <news2020@bartheld.net> wrote:

> On Thu, 19 Nov 2020 15:38:12 GMT, Russell Marks wrote:
>> Volker Bartheld <news2020@bartheld.net> wrote:
>>> On Wed, 18 Nov 2020 23:20:04 GMT, Russell Marks wrote:
>>>> I seem to remember the IF1 port was very slow
>>> Well. The Z80 CPU runs at 3.5 MHz, there is no SIO available and the 16550
>>> UART (with FIFO) was born years after the Spectrum. In that light, serial
>>> communication via software...
>> To be fair, I don't think I ever used the IF1 port - it's just the
>> impression I had at the time. I could have phrased that better.
>
> Verdict: It's not USB3. Surprise, surprise. ;-)

...

Seriously?

-Rus.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.sinclair


csiph-web