Controlling RTS

General discussions related to the Altair 8800 Clone
Post Reply
JNZ
Posts: 32
Joined: March 13th, 2015, 1:13 pm
Contact:

Controlling RTS

Post by JNZ »

I wrote a small program to toggle RTS high and low, with a simple delay between states. However, I seem to be doing something wrong, as I see RTS remaining low. I suspect that I don't understand the proper way to toggle it; I'm currently trying to do it by outputting an octal 021 on 020 (the control register) for low, and a 221 for high. I got this from the 88-2 SIO board operation manual available in the support section of altairclone.com.

My program follows. The random 004, 010, etc. are code offsets to help me calculate the relative jumps

Code: Select all

init:
	mvi a, 003
	out 020
toggle:
004
	mvi a, 021
	out 020
d1:
010
	mvi a, 0
	inr a
	jnc d1
	mvi a, 221
	out 020
d2:
022
	mvi a, 0
	inr a
	jnc d2
	jmp toggle

Even just toggling in the following doesn't set RTS high:

Code: Select all

mvi a,221
out 020
Does RTS not change until you output a character, or something?
AltairClone
Site Admin
Posts: 661
Joined: April 5th, 2013, 10:55 am
Contact:

Re: Controlling RTS

Post by AltairClone »

Toggling between 021Q and 221Q is actually just turning receive interrupts off and on.

To assert RTS (low at the UART, high on DB25):
021Q (11H) for 8N2
025Q (15H) for 8N1

To de-assert RTS (high at the UART, low on DB25):
121Q (51H) for 8N2
125Q (55H) for 8N1

Finally, jumper wires have to be installed on the 2SIO to route RTS from the 6850, through a 1488 line driver, and then to the DB25. On the Clone, this "wiring" is done in the serial port menu of the configuration monitor by choosing "2) Only RTS Used" or "4) CTS, RTS Both Used"

An echo routine with manual controllable RTS is on the support page under "Front Panel Programs->echorts.asm"

Mike
JNZ
Posts: 32
Joined: March 13th, 2015, 1:13 pm
Contact:

Re: Controlling RTS

Post by JNZ »

Thanks! I messed up converting binary to octal. Your program helped a lot, and I missed it, I think because I figured that folder exclusively contained copies of what's in your videos. This stuff is probably super simple to you, but thanks for being so responsive on the forums! I hope you find it fun to guide beginners.

For others, these were the only changes necessary to make my program work, resulting in it outputting a 20.83 kHZ square wave.

Code: Select all

init:
	mvi a, 003
	out 020
toggle:
004
	mvi a, 125
	out 020
d1:
010
	mvi a, 0
	inr a
	jnc d1
	mvi a, 025
	out 020
d2:
022
	mvi a, 0
	inr a
	jnc d2
	jmp toggle
Those values are all octal.

Here it is in octal opcodes:

Code: Select all

       0   1   2   3   4   5   6   7  
000: 076 003 323 020 076 125 323 020
010: 076 000 074 322 010 000 076 025
020: 323 020 076 000 074 322 022 000
030: 303 004 000
040:
050
Oh, one important thing. I was using pin 7 on my DB-9 connector (DB-25 to DB-9 straight-through cable), and for some reason it's toggling it on pin 8. I thought pin 8 was CTS and pin 7 is RTS. Maybe they're reversed at the terminating end? I probably don't understand something about serial.

Now I'm going to see if I can run CP/M over the 2nd SIO port (which I believe doesn't emulate CTS/RTS, as the admin menu says it's always asserted, IIRC). That'd let me do my RTS/CTS experiments on port 1, and use a more convenient environment on port 2.
JNZ
Posts: 32
Joined: March 13th, 2015, 1:13 pm
Contact:

Re: Controlling RTS

Post by JNZ »

Also, is it "really" going 5.6V to -4.96V? Or is this relative to the GND pin, which is actually 1/2 VCC, with VCC being about +12V in this case? I suppose I should compare GND to earth GND and see if there's a voltage differential.

For fun:

Image

Edit: Yes, it really is 5.6V to -4.96V, as part of the RS-232 spec.
AltairClone
Site Admin
Posts: 661
Joined: April 5th, 2013, 10:55 am
Contact:

Re: Controlling RTS

Post by AltairClone »

RS232 signals are always confusing. RTS on one end of the cable is CTS on the other end and vice-versa. Same with transmit data and receive data, of course. For this reason, the wires are "named" relative to the DTE end of the connection (the PC in your case - the Altair is wired as DCE). Therefore the "CTS" wire on an RS-232 cable is RTS out from DCE (e.g., the Altair) and CTS in on DTE (e.g., the PC).

Port 2 on the Altair Clone, when configured as the 2nd 2SIO port, also supports RTS and/or CTS. The Serial Port menu in the Configuration Monitor lets you change these options, so you can use the 2nd port for your RTS work.

Mike
JNZ
Posts: 32
Joined: March 13th, 2015, 1:13 pm
Contact:

Re: Controlling RTS

Post by JNZ »

Thanks, I was able to configure my 2nd port as a 2SIO port with RTS/CTS.

I discovered something interesting: on a new, straight-through (AFAIK) Belkin serial cable the signaling happens not on the CTS line, but on the DTR line! When I switch cables, it's back to CTS, so it's not code or the Altair doing it. Is this a common occurrence? Is this cable miswired, or is there a lack of consistency?
AltairClone
Site Admin
Posts: 661
Joined: April 5th, 2013, 10:55 am
Contact:

Re: Controlling RTS

Post by AltairClone »

JNZ wrote:I discovered something interesting: on a new, straight-through (AFAIK) Belkin serial cable the signaling happens not on the CTS line, but on the DTR line! When I switch cables, it's back to CTS, so it's not code or the Altair doing it. Is this a common occurrence? Is this cable miswired, or is there a lack of consistency?
It is not unusual to use DTR as the handshake output from a DTE device. The cable you've found is not "straight-through," but specifically wired to support a DTR handshake of some sort. You might want to buzz the cable out and see how the pins route from one end to the other.

Mike
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest