Tests for EF3 and Q serial circuits


This Web page supports the 1802 Membership Card. Last updated Mar 14 2014. Edited by Herb Johnson, (c) Herb Johnson, except for content written by Lee Hart and others. Contact Herb at www.retrotechnology.com, an email address is on that page.

Introduction

Rev G of the 1802 Membership Card, and modified earlier revisions, have an option of a software-based serial port based on Q and EF3. LEDs on each revision respond to Q and (depending) to EF3. Voltage-shifting circuits are needed to provide proper logic voltages to and from EF3 and Q, from external serial devices which may be TTL or RS-232 voltages. Those circuits are described in another Tech Note, or in the Revision G and later assembly manuals and documents. This note provides some simple testing software, to exercise Q and EF3 and those serial circuits. But results of those tests can be complicated. They depend on the serial hardware through to Q and EF3 on the CPU board. So this note also provides technical guidance, plus links to useful documents. - Herb Johnson

Quick tests for EF3 and Q serial circuits

For a serial test of your Membership Card without a terminal or computer:

For Rev G or later CPUs with serial circuits installed: Short DB-25 pins 20 and 15. Toggle in the "blink Q with EF3" program below and see if the red/green Q/EF3 LED blinks between green and red. If not, you may have set up your serial interface circuits such that both invert the incoming RS-232 or TTL signal, or neither invert. In that case, change the instruction at location 8 "to compliment Q with EF3" as described, so the software inverts between Q and EF3. See if that works for the red and green LED to "take turns".

If you don't get the results you expect, read the rest of this note to learn what the issues may be. How you've wired up the serial interface circuits determines how these programs affect both LEDs. If you expect both red and green LED lights at once (yellow), Lee Hart explains that may not happen sometimes.

If you have a rev F or earlier Membership Card modified for serial, you will only have a red LED on Q. Bu you can still use the blink program. Use a voltmeter or logic probe, to observe EF3 at pin 22 on the 1802 CPU chip. Q is 1802 CPU pin 4.

For a software loopback test of serial, connect a terminal (or computer with terminal program) to your M/S Card serial interface and toggle in and run the serial loopback program below. Depending on your interface, you may need to make the "compliment EF3" change to the program. If you don't get an "echo" of what you type at the terminal, review how you've set up your serial interface, and read this note in detail to sort out what may be going on.

Because there's no predicting what serial devices a Membership Card owner may use, or how they set up their Membership Card, there's no single "plug and play" solution for testing or use of the serial options. If a specific solution emerges from common practice, this note and relevant documents will be updated accordingly. - Herb Johnson

Serial Hardware

The Front Panel schematic for Rev G, shows pin 20 of the DB-25 connector is a serial input to EF3 for RS-232 or TTL type signals; and Pin 15 of the DB-25 is a serial output from Q. Circuits on the front panel board, condition those signals for Q and EF3 - they may "invert" the logic or not. Refer to the Rev G schematic and manual, and your construction, for details. On the Rev G card, EF3 and Q have a two-color LED, Green for EF3 and Red for Q, The operation of that LED pair has subtle issues..

Tech Note about transistors with internal resistors, used on the M/S card serial I/O.

For Rev F 1802 M/S cards and earlier versions, Q is directly brought out to pin 15. EF3 is not brought out but modifications to the Front Panel card could bring it out directly to pin 20. Conditioning circuits connected externally to the DB-25 at those pins, can convert RS-232 signals to TTL levels, and may invert the logic or not. See this Tech Note on serial modifications to a Rev F card. For Rev F and earlier, there is only a red LED for Q.

CPU hardware

If you want to check the Q and EF3 pins at the CPU chip, EF3 is pin 22. Q is CPU pin 4. For programs that SLOWLY change Q or EF3, you can monitor these with a logic probe, or an LED with a series resistor of a few hundred ohms to +5, or a voltmeter, or an oscilloscope. Fast changes require an oscilloscope.

Software testing with Q only

Membership card test software includes a program to blink the Q LED at a slow, visual rate. At 1.8Mhz it blinks a few times a second. At the lowest trimpot setting, it's several seconds a blink. On the Rev G card, EF3 and Q have a two-color LED, Green for EF3 and Red for Q. ON rev F and earlier, there is only a red LED for Q.

Presuming a Rev G M/S card with serial circuits: In principle, if you shorted DB-25 pin 20 to 15, and ran that "blink Q" program, you would expect to see the Red or the Green LED lights - or yellow if both were lit. Here's what Lee Hart noticed:

Gotcha with red & green LED, Lee Hart: "An interesting quirk: Q=1 lights the red LED, and EF3=1 lights the green LED. So you would think that both would light in this loop test, and you'd see yellow. But both LEDs share the same series resistor, and the green LED has a higher forward voltage drop. This means you don't see the green LED; D8 just lights up red. To see green, you can jumper DB25 pin 20 to power or ground while Q=0."

"When you are feeding in TTL or RS-232 data whose high-state voltage is greater than the Membership Card's supply, then the green does light even if the red is lit. [Or] you can enter a trivial program to check EF3, and set Q to the opposite state. Then the LED lights either red or green, depending on the logic level at RXD (DB25 pin 20). This proves that both EF3 and Q and the LED circuits all work." - Lee Hart

Program for blink Q and EF3

Please note: The state of Q and EF3 at the CPU chip, depends on the circuits which "condition" Q and EF3, and how the two are connected - either to each other, or to some device like a terminal or computer serial device. You will have to figure out (or recall) if Q and or EF3 are "inverted" logically, to make sense of the operation of these programs, with those connections. OK? Refer to the Rev G assembly manual, and your notes on your modifications to support serial use.

A modification of the Membership card test software "blink Q" to add a test for EF3, is not complicated. First, to read EF3, you need one of these instructions:


	36 nn		B3 nn		;branch if EF3=1
	3E nn		BN3 nn	;branch if EF3=0

Second, the test for the status of Q is changed to a test for the status of EF3. Here's the code for "blink Q slowly", for Q to follow EF3. With this code, Q is low when EF3 is low. If you connect Q out to EF3 in (DB-25 pins 20 and 15), Q will also control EF3, through your serial circuits, at a visual rate.

;Blink Q with EF3
    0001                 R1	EQU	1

    0000                 start ORG	0H
    0000   7a            	REQ		;reset Q
    0001   f8 10         L0:	LDI	10H	;counter
    0003   b1            	PHI	R1	;into high R1
    0004   21            L1:	DEC	R1	;decrement
    0005   91            	GHI	R1	;
    0006   3a 04         	BNZ	L1	;branch until R1 is zero
    0008   3e 00         	BN3	start	;if EF3 low, Q low
    000a   7b            	SEQ		;otherwise set Q
    000b   30 01         	BR	L0	;and branch to counter
    000d                 	END

For EF3 to compliment Q, that is Q is high when EF3 is low, change the instruction at location 8 as follows:

    0008   36 00         	B3	start	;if EF3 high, Q low

As Lee Hart described above, what you see on the EF3 LED depends on your circuits between Q and EF3. And the serial hardware as noted above, may or may not invert the logic of either signal. That's why there is two kinds of software logic shown here, to invert in software or not.

Software serial loopback

For serial operation using a terminal device, that device will provide a logic signal at some baud rate; and it will read a logic signal at the SAME baud rate. If you connect a terminal's transmit and recieve together, it will echo or "loopback" its output to its input. The Membership Card can be set up to "loopback" a serial signal in the same way. A simple, fast program to sample EF3 in and immediately control Q out, will (in principle) send back the same bits that the terminal produces - an "echo", with software.

For Q to follow EF3 that loop looks like this:

;serial loopback
    0001                 R1	EQU	1

    0000                 start	ORG	0H
    0000   7a            	REQ		;reset Q
    0001   3e 00         L0:	BN3	start	;if EF3 low, Q low
    0003   7b            	SEQ		;otherwise set Q
    0004   30 01         	BR	L0	;and branch to test
    0006                 	END

For Q to compliment EF3 make this change:

    0001   36 00         L0:	B3	start	;if EF3 high, Q low

The LED's for Q and EF3 may change too fast to observe but may stay lit long enough to see. The terminal "should" be able to "read" the same characters it's "writing", if the loop runs fast enough and the baud rate is not too fast. But as Lee Hart explains, you may not see both green and red (yellow) at the same time, depending on your serial interface hardware.


This page and edited content is copyright Herb Johnson (c) 2014. Contact Herb at www.retrotechnology.com, an email address is available on that page..