JE665_RS232_Interface_Users_Maunual_1983 JE665 RS232 Interface Users Maunual 1983

JE665_RS232_Interface_Users_Maunual_1983 JE665_RS232_Interface_Users_Maunual_1983

User Manual: JE665_RS232_Interface_Users_Maunual_1983

Open the PDF directly: View PDF PDF.
Page Count: 20

DownloadJE665_RS232_Interface_Users_Maunual_1983 JE665 RS232 Interface Users Maunual 1983
Open PDF In BrowserView PDF
Jameco'

JE665
RS-232C INTERFACE

USER'S MANUAL
Operation and Programming

.,,.
.

JAMECO ELECTRONICS, 1355 SHOREWAY
ROAD, BELMONT,CA 94002 (415) 592·8097
.
.

This manual is intended as a supplement to the JE664 EPROM Programmer Operation Manual. It
describes the operation and programming of the JE665 RS·232C Interface Option. Complete details
are given for connection of the JE665 to any computer with a spare RS-232C port (9600 baud, 8 data
bits, 2 stop bits, odd parity). A sample program is provided in Microsoft* MBASIC for implementation
on CP/M t systems.

JAMECO ELECTRONICS makes no warranties, expressed or implied, concerning the accuracy of
this manual. Every effort is made to insure that the contents are correct but errors may occur.

Second Edition

© 1983 by Jameco Electronics
1355 Shoreway Road
Belmont, CA 94002
(415) 592-8097
Written by David H. Nelson -

Jameco Electronics

* Microsoft and MBASIC are registered trademarks of Microsoft Corp.
t CPIM is a registered trademark of Digital Research, Inc.

Table of Contents

1

2
3

4
5

INTRODUCTION

ii

THE RS·232C INTERFACE

1

THEORYOFOPERATION

2

JE665 PROGRAM

4

JE665 PROGRAM MODIFICATION

10

USING THE JE665 PROGRAM

13

APPENDIX A -

JE665 SCHEMATIC DIAGRAM

APPENDIX B -

JE665 ASSEMBLY DRAWING AND COMPONENT MATERIAL LIST'

Introduction
The JE665 option is a circuit board that implements the RS-232C standard interface to allow
connection of the JE664 EPROM Programmer to a computer system. The JE665 requires a spare
RS-232C port capable of 9600 baud, 8 data bits, 2 stop bits and odd parity.

A sample program is provided in Microsoft MBASIC for implementation on CP/M computers. Modifications may be necessary due to the different hardware configurations available. These changes are
explained in detail.

When connection is complete, the computer will have access to the RAM inside the JE664. This allows
for convenient data storage and manipulation with the computer.

ii

The RS·232C Interface
The RS-232C interface is an EIA (Electronic Industries Association) "Recommended Standard" interface. It transmits and receives data in serial form, one bit at a time.

There are no physical requirements for the RS-232C except that it use a 25-pin connector. Accepted
practice is to use a 25-pin "0" connector (0825). The connector on the JE665 is of the female gender
and requires a male mate on the cable. Only six (6) of the 25 lines are used by the JE665. Table 1 lists
these lines and indicates the direction of signal travel. They will be described in more detail later.

Table 1_ Name and Origins of Signals Used in the JE665
PIN

NAME

DESCRIPTION

SIGNAL ORIGIN

20
7

DTR
GND

Data Terminal Ready
Signal Ground

Computer

6

DSR

Data Set Ready

JE665

5

CTS

Clear to Send

JE665

3
2

TXD
RXD

Transmit Data
Receive Data

JE665
Computer

---

RS-232C voltage levels are different than standard logic levels. A voltage between + 3 and + 15V
indicates a "High" (logic "a" on the JE665) and a voltage between -3 and -15V indicates a "Low"
(logic "1" on the JE665). Notice that these signals are "inverted" (Le. negative voltage equals logic 1)
on the JE665. This is normal but may not be the case on some computers.

A cable is required to connect the JE664/JE665 to your computer. It is recommended that you use a
cable with removable pins so that lines may be swapped if necessary. The cable must have at least the
six indicated lines, but may have all 25.

In order to transmit data over the RS-232C link, there must be some way to indicate to each device that
a data transfer will occur. These protocols help assure that both devices are ready and that the data
you wish to transfer does, in fact, get transferred.

Data accuracy is another important aspect of the RS-232C link. Each byte is checked for proper
transfer to and from the JE665. Hardware parity checking is implemented.

1

Theory of Operation
To access the JE665 from your computer, certain events must occur in the correct order. As long as
the proper signals are present the JE665 will communicate properly: But if they are not you may have
unexpected difficulties.
The first signal to occur comes from the JE665. This is the DSR (Oata Set Reaoy,t;lfIl: 6) line. It will be
held high (RS-232C + 3 to + 15V) by the JE665 when the cable is connected and the
IPRGM PULSES/RS 2321 switch is in the IRS 2321 pOSition. lfindicates that the programmer is ready.
After the computer determines that the programmer is ready it will set the DTR (Data Terminal Ready,
pin 20) line low (-3 to -15V) and then back high (+ 3 t'o + 15V). This will reset the JE665 and tell it to
expect a control word next. It will also set the CTS (Clear to &end, pin 5) line low (-3 to ...:15V) signalling
that the J E665 expects a control word.

Control Code

•

7

6

5

4

3

2

1

o

1

o

1

o

x

x

x

x

I

t

Control Bit 0 - control word follows
1 - data follows
--------'

Address Clear Disable 0 - clear address
1 - don't clear _ _ _ _ _ _ _ _ _....J
Write Enable 0 1Shift 0 1-

load from programmer
-------------~
save to programmer

lower 32K - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
upper 32K

Figure 1 -

Control Word Detail

The JE665 uses control words to tell itwhat to do and what to expect next. The control words are sent
in the exact same way that the other data is sent, but there is one difference. The JE665 expects the
upper four bits of the coo.troJ word to be 1010 {A Hex). The lower four bits are the actual commands to
the programmer. These commands can select the upper or lower 32K of the programmers RAM, clear
the address, select the read or write option, and tell whether or not another control word follows
. (Figure 1 and Table 2). It should be noted that more than one control word can be sent in succession.
The only requirement is that the last control word must have the control bit (bit 3) set. At this point no
further control words are accepted until 256 data bytes have been transferred.

2

After the correct control word(s) are sent, the last one having the control bit (bit 3) set, the actual data
will follow. A block of 256 bytes will be transferred. If the transfer is to the programmer then each byte
will be sent and immediately read back. This will verify that the transfer Wl:fS correct. If the transfer is
from the programmer then a dummy byte will be sent and the byte returned will be the desired data.
After the 256 byte block has been transferred, the CTS line will again be set low (-3 to -15V)
acknowledging that the block was accepted and indicating that the JE665 expects another control
word.
The proper control word(s) are sent followed by another 256 byte data block. This cycle is repeated
until all of the data is transferred or until the end of the lower 32K bits is reached. If the lower 32K is filled then two new control words are sent that select the upper 32K. The cycle of 256 byte blocks and
control words is then repeated until all of the data has been transferred. (Note: The UPPER 32K LED on
the JE664 front panel will NOT change when the RS232 is active even though the 32K segment may
change. When returning to manual control of the programmer be sure that you are in the upper or
lower 32K as necessary).

Table 2 -

Control Word Definitions

Control word
Hex (Binary)

Will
Follow

Clear
Address

AO(1010 0000)

control word

yes

lower

Ai (10100001)

control word
control word

yes

upper

no
no

lower
upper

A4(1010 0100)
A5(1010 0101)
A8(1010 1000)

control word

Read
Write

U/L
32K

A9(1010 1001)

data
data

yes

read

lower

yes
yes

read

upper
lower

AA(1010 1010)

data

AB(1010 1011)
AC(1010 1100)
AD(1010 1101)

data
data
data

yes
no

write
write
read

no

read

upper

AE(1010 1110)
AF(1010 1111)

data
data

no
no

write

lower
upper

write

upper
lower

3

JE665 Program
The sample program ofthis chapter is provided to help you make the connection from the JE665 to
your computer. It has all the features necessary for data transfer, data storage and data entry. You
. may choose to use it or you may write your own.
The program was written in Microsoft MBASIC version 4.51. If you have MBASIC you can enter the program into your computer and save it as "JE665." The next chapter explains how to customize it to your
specific computer.
If you choose to write your own program, carefully follow the sample program and THEORY OF
OPERATION. You may use another BASIC or a different language. You will also need to read JE665
PROGRAM MOD/FICA TlON.
The following is a breakdown of the lines in the JE665 program. Beginning and ending line numbers
are shown as well as a description of the function of each routine.

4

Line
Numbers

Description

100
300
500
1000
2000
3000
4000
5000
6000
7000
8000
8100
8300
8400
8500

280
470
700
1230
2240
3370
4390
5340
6240
7060
8040
8260
8350
8470
8520

Initialization, credits and start up message
Select EPROM size to work with
Main program menu
Get data from disk
Put data on disk
Load data from programmer
Save data to programmer
View data (ASCII and Hex)
Enter data
Exit from the program
Clear the screen
Get a file name
Handle any errors when opening files
Convert hex to decimal (SA$ to SA)
Handle "NO EPROM FILES"

9000
9100
9200
9300
9400
9500

9070
9130
9230
9330
9460
9530

Set up the RS-232C port 9600 baud, 8 data bits, 2 stop bits, odd parity
Check the P§B line (bit) If DSR is on return F = 1 otherwise F = 0
.
Toggle the DTR line (bit) ofnhen back on
Check the CTS line (bit). If CTS is off then F = 1. otherwise F = 0
Send a data byte from DS and get echo i nl5R
Send a control word from D

JE665 Program
100 'JE665 RS-232C SERIAL COMMUN.ICATION PROGRAM
llQ'BY DAV.ID Ii NELSON
12~ 'SEPTEMBER 14, 1983
'CLEAR THE SCREEN
130 GOSUB 8000
1·40 CLEAR 1000
150 PRINT TAB(26).;"J.AMECO l!;LECTRONICS":PRINT
16,0 PRINT TAB(20) j"JE6.f)5 RS-232C INT.ERFACE'OPTION" : PRINT
170 PRINT TAB(21) j "SERIAL COMMUNICATION PROGR~":PRINT:PRINT
180 PRINT TAB.( 26) j "SEPTEMBER 14, 1983"
1,90 PRINT : PRINT: PRINT = PRINT : PRINT : PRINT
200 PRINT "INITIALIZING.
"
210 '***** INITIALIZATION *****
220 F$="GPLSVECX"
230 CS=2:SI$="16KDlt (2K x 8) EPROM active"
240·BA=28672
250 FOR X=BA TO BA+8192
260
POKE X,255
1270 NEXT X
280 DEF FNH$(X} = RIGHT$("00"+HEX$(PEEK(BA+X)),2)
300 'SELECT EPROM SIZE
'CLEAR SCREEN
310 GOSUB 8000
320 PRINT TAB(10)jSI$:PRINT
(lK x 8)"
330 PRINT TAB(20)j"1 - 8Kbit
340 PRINT TAB(20);"2. - 16Kbit (2K x 8) "
350 PRINT TAB(20)j"3 - 32Kbit (4K x 8)"
360 PRINT TAB(20)j"4 - 64Kbit (8l( x 8)"
370 PRINT : PRINT : PRINT
380 PRINT" SELECT EPROM SIZE >"j
390A$=INPUT$(1)
400 IF A$=CHR$(13) THEN 500
410 CS=VAL(A$)
420 IF CS4 THEN 390
(IK x 8) EPROM active"
430 IF CS=l THEN SI$="8Kbit
440 IF CS=2 THEN SI$="16Kbit (2K x 8) EPROM active"
450 IF CS=3 THEN SI$="32Kbit (4K x 8 ) EPROM active"
460 IF CS=4 THEN SI$="64Kbit (8K x 8 ) EPROM active"
470 CS=INT«2 A CS)*2+.5)
500 '***** MAIN PROGRAM *****
510 GOSUB 8000
'CLEAR SCREEN
520 PRINT TAB(20)j"« JE665 MAIN MENU »":PRINT
530 PRINT TAB(20);"G - GET DATA FROM DISK"
540 PRINT TAB(20)j"p - PUT DATA ON DISK"
650 PRINT TAB(20);"L - LOAD DATA FROM PROGRAMMER"
560 PRINT TAB(20);"S - SAVE DATA TO PROGRAMMER"
570 PRINT TAB(20);"V - VIEW DATA"
580 PRINT TAB(20)j"E - ENTER DATA"
590 PRINT TAB(20);"C - CHANGE EPROM SIZE"
600 PRINT TAB(20)j"X - EXIT THIS PROGRAM"
PRINT
610 PRINT: PRINT: PRINT TAB(lO)jSI$ : PRINT
620 PRINT TAB(10)i"ENTER SELECTION >"j
630 S$=IN,PUT$ (1)
640 IF S$="C" THEN 300
650 FOR S=lT08
660
IF S$=MID$(F$,S,l) THEN 690
670 NEXT S
680 GOTO 630
690 ON S GOSUB 1000 , 2000 , 3000 , 4000 , 5000 , 6000 , 7000 , 7000
700 GOTO 500
1000 '***** GET DATA FROM DISK *****
1010 GOSUB 8000
'CLEAR SCREEN
1020 PRINT TAB(10);"GET DATA FROM DISK":PRINT
1030 PRINT
'GET FILENAME·
1040 GOSUB 8100
1050 IF FI$="" THEN RETURN
'ERROR ROUTINE
1060 ON ERROR GOTO 8300
1070 OPEN nR",ll,FI$
1080 FIELDIl,128 AS R$
'NO MORE ERROR HANDLING
1090 ON ERROR GO TO 0

5

JE665 Program (continued)
1100
'1110
1120
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
2000
2010
2020
2030
2040
2050
2060
2070
2080
2090
2100
2110
2120
2130
2140
2150
2160
2170
2180
2190
2200
2210
2220
2230
2240
3000
3010
3020
3030
3040
3050
3060
3070
30'80
3090
3100
3110
3120
3130
3140
3150
3160
3170
3180
3190
3200
3210
3220
3230
3240
3250
3260
3270

6

PRINT
PRINT "GETTING DATA • • • "
PRINT "[";TAB(CS*2);"]"
FOR x = 1 TO CS*2
GET#l,X
PRINT "*";
FOR y%=1 TO 128
POKE BA+(X-l)*128+Y%-1,ASC(MID$(R$,Y%,1»
NEXT Y%
NEXT X
PRINT : PRINT
PRINT "FUNCTION COMPLETE"
CLOSE 1
RETURN
'***** PUT DATA ON DISK *****
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(10);"PUT DATA ON DISK":PRINT
PRINT
'GET FILENAME
GOSUB 8100
IF FI$="" THEN RETURN
'ERROR ROUTINE
ON ERROR GO TO 8300
OPEN "R",#l,FI$
FIELD#1,128 AS R$
ON ERROR GO TO 0
PRINT
PRINT "PUTTING DATA
"
PRINT "[";TAB(CS*2);"]"
FOR X=l TO CS*2
PRINT "*";:P$=''''
FOR Y%=1 TO 128
P$=P$+CHR$(PEEK(BA+(X-l)*128+Y%-1»
NEXT Y%
LSET R$=P$
PUT#l,X
NEXT X
PRINT : PRINT
PRINT "FUNCTION COMPLETE"
CLOSE 1
RETURN
'***** LOAD DATA FROM PROGRAMMER *****
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(10);"LOAD DATA FROM PROGRAMMER":PRINT
PRINT
'SET UP PORT
GOSUB 9000
'CHECK DSR LINE
GOSUB 9100
IF F=l THEN 3100
PRINT "PRESS  WHEN PROGRAMMER IS READY"
A$=INPUT$(l):IF A$<>CHR$(13) THEN RETURN
GOTO 3050
GOSUB 9200
'TOGGLE DTR LINE
D=161:GOSUB ~500
'SEND CONTROL WORD Al
NB=CS-l
'NUMBER OF BLOCKS - 1
Nl=NB:IF NB=31 THEN Nl=15
PRINT : PRINT "LOADING DATA
"
FOR X=O TO Nl
D=168:GOSUB 9500
'SEND CONTROL WORD A8
FOR Y=O TO 255
DS=255:GOSUB 9400:POKE BA+X*256+Y,DR
'GET A BYTE
NEXT'Y
GOSUB9JOO
'CHECK CTS LINE
IF ,F=O THEN PRINT "NO ACKNOWLEDGE FROM PROGRAMMER":A$=INPUT$(l):RETURN
NEXT X
IF NB<>31 THEN RETURN
D=160:GOSUB9500
\SEND CONTROL WORD AO
D=169:GOSUB 9500
'SEND CONTROL WORDA9
FOR X=O TO 15
FOR Y=O TO 255

JE665 Program (continued)
3280
3290
3300
3310
3320
3330
3340
3350
3360
3370
4000
4010
4020
4030
4040
4050
4060
4070
4080
4090
4100
4110
4120
4130
4140
4150
4160
4170
4180
4190
4200
4210
4220
4230
4240
4250
4260
4270
4280
4290
4300
4310
4320
4330
4340
4350
4360
4370
4380
4390
5000
5010
5020
5030
5040
5050
5060
5070
5080
5090
5100
5110
5120
5130
5140
5150
5160

DS=255 :GOSUB 9400-: POKE BA+4096+X*256+Y, DR
'GET A BYTE
NEXT Y
GOSUB 9300
'CHECK CTS LINE
IF F=O THEN PRINT "NO ACKNOWLEDGE FROM PROGRAMMER":INPUT$(l):RETURN
D=173:GOSUB 9 5 0 0'
'SEND CONTROL WORD AD
NEXT X
GOSUB 9200
'TOGGLE DTR LINE
D=161:GOSUB 9500
'SEND CONTROL WORD Al
D=168:GOSUB 9500
'SEND CONTROL WORD A8
RETURN
'***** SAVE DATA TO PROGRAMMER *****
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(10);"SAVE DATA TOPROGRAMMER":PRINT
PRINT
GOSUB 9000
GOSUB 9100
'CHECK DSR LINE
IF F=l THEN 4100
PRINT "PRESS  WHEN PROGRAMMER IS READY"
A$=INPUT$(l):IF A$<>CHR$(13) THEN RETURN
GOTO 4050
GOSUB 9200
'TOGGLE DTR LINE
D=161:GOSUB 9500
'SEND CONTROL WORD Al
NB=CS-l
'NUMBER OF BLOCKS - 1
Nl=NB:IF NB=31 THEN Nl=15
PRINT : PRINT "SAVING DATA
"
FOR X=O TO Nl
'SEND CONTROL WORD AA
D=170:GOSUB 9500
FOR Y=O TO 255
DS=PEEK(BA+X*256+Y):GOSUB 9400
IF DS<>DR THEN PRINT "VERIFY ERROR AT ";X*256+Y:A$=INPUT$(1):RETURN
NEXT Y
GOSUB 9300
'CHECK CTS LINE
IF F=O THEN PRINT "NO ACKNOWLEDGE FROM PROGRAMMER":A$=INPUT$(l):RETURN
NEXT X""'...e
IF NB<>31 THEN RETURN
'SEND CONTROL WORD AO
D=160:GOSUB 9500
D=171:GOSUB 9500
'SEND CONTROL WORD AB
FOR X=O TO 15
FOR Y=O TO 255
DS=PEEK(BA+4096+X*256+Y):GOSUB 9400
IF DS<>DR THEN PRINT "VERIFY ERROR AT ";4096+X*256+Y:A$=INPUT$(1):RETURN
NEXT Y
GOSUB 9300
'CHECK CTS LINE
IF F=O THEN PRINT "NO ACKNOWLEDGE FROM PROGRAMMER":INPUT$(l):RETURN
D=175:GOSUB 9500
'SEND CONTROL WORD AF
NEXT X
GOSUB 9200
'TOGGLE DTR LINE
D=161:GOSUB 9500
'SEND CONTROL WORD Al
D=168:GOSUB 9500
'SEND CONTROL WORD A8
RETURN
'***** VIEW DATA (~SCII AND HEX) *****
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(lO);"VIEW DATA (ASCII AND HEX) ":PRINT
SA$="o-"
INPUT "ENTER THE STARTING ADDRESS (0 TO IFFF) ";8A$
GOSUB 8400
'HEX TO DECIMAL
IF SA>8191 THEN 5030
\ : II
\ \
\
: \
\
\ \
US$="\· \ \
\ \
\
PRINT : PRINT
PRINT "ADDR
DATA HEX
DATA ASCII"
PRINT "---FOR X=lT016
AD$
RIGHT$("0000"+HEX$(SA),4)
Hl$ = FNH$(SA)+FNH$(SA+l)*FNH$(SA+2)+FNH$(SA+3)
H2$
FNH$(SA+4)+FNH$(SA+5)+FNH$(SA+6)+FNH$(SA+7)
H3$
FNH$ (SA+8) +FNH$ (SA+9) +FNH$ (SA+lO) +FNH$ (.sA+11)
H4$
FNH$(SA+12)+FNH$(SA+13)+FNH$(SA+l4)+FNH$(SA+l5)

-------------------"

7

JE665 Program (continued)
5170
S'i80
'51~0

5200
5210
5220
5230
5240
5250
5260
5270
5280
5290
5300
5310
5320
5330
5340
6000
6010
6020
6030
6040
6050
6060
6070
6080
6090
6100
6110
6120
6130
6140
6150
6160
6170
6180
6190
6200
6210
6220
6230
6240
7000
7010
7020
7030
7040
7050
7060
8000
8010
8020
8030
8040
81.00
81J;O
8120
8130
8140
8150
8160
8170
8180
8190

8

Al$=h" : A2$=""
FOR Y=O TO 7
A = PEEK (BA+SA+Y) .
IF A<32 OR A>127 THEN A1$=Al$+"." ELSE A1$=A1$+CHR$1~)
NEXT Y
".
FOR Y=8 TO 15
A = PEEK (BA+SA+Y)
IF A<32 OR A>127 THEN A2$=A2$+"." ELSE·A2$=A2$+CHR$(A)
NEXT Y
PRINT USING US$;AD$,Hl$,H2$,H3$,H4$,Al$,A2$
SA=SA+16
IF SA>=8192 THEN PRINT:PRINT "PRESS ANY KEY FOR MENUh;:A$=INPUT$(l):RETURN
NEXT X
PRINT : PRINT : PRINT .
PRINT hPRESS  TO CONTINUE - 'A' FOR NEW ADDRESS - ANY OTHER FOR MENU";
A$=INPUT$(l):IF A$=CHR$(13) THEN PRINT: GOTO 5080
IF A$=RA w THEN 5000
RETURN
,***.* ENTER DATA .****
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(10);"ENTER DATA":PRINT
SA$="O"
INPUT "ENTER THE STARTING ADDRESS (0 TO 1FFF) ";SA$
GOSUB 8400
'HEX TO DECIMAL
IF SA>819T THEN 6030
AD=SA
.
AD$=RIGHT$ (,"OOOO"+HEX$ (AD) , 4)
PRINT AD$; 0:"; .
1$=""
INPUT 1$
IF 1$="0 THEN 6240
FOR X=l TO LEN(I$)
IF MID$(I$,X,l)=" R THEN I$=LEFT$(I$,X-l1+RIGHT$(I$,LEN(I$)-X):GOTO 6140
NEXT X
L=LEN(I$):IF L/2<>INT(L/2) THEN 6090
FOR Z=l TO L-1 STEP 2
SA$=MID$(I$,Z,2)
GOSUB 8400
'HEX TO DECIMAL
IF SA>255 THEN 6080
POK.E BASE+AD,SA : AD=AD+l
IF AD>8191 THEN 6030
NEXT·Z
GOTO 6080
RETURN
'EXIT THIS PROGRAM
PRINT : PRINT : PRINT
PRINT RARE YOU READY TO EXIT (YIN)?";
IF INPUT$(l)<>"Y" THEN RETURN
GOSUB 8000
'CLEAR SCREEN
PRINT TAB(55);"THANK YOU"
GOTO 9999
'CLEAR THE SCREEN
FOR ZZ=l TO 25
PRINT
NEXT ZZ
RETURN
'GET A FILENAME
OR ERROR GO TO 8500
PRINT: PRINT "DIRECTORY:"
FILES "*.ROM"
PRINT
PRINT
FI$="R
INPUT RENTER THE NAME OF THE FILE ";FI$
LF = LEN(FI$)
CL = INSTR(FI$,R:")
IF CL<>O AND CL<>2 THEN 8140
IF CL=O AND LF>8 THEN 8140
IF LF>10 THEN 8140

JE665 Program (continued)
8200
8210
8220
8230
8240
8250
8260
8300
8310
8320
8330
8340
8350
8400
8410
8420
8430
8440
8450
8460
8470
8500
8510
8520

PD = INSTR(FI$,".")
IF PD>O THEN 8140
IF LF<1 THEN FI$=""
RETURN
FI$ = FI$+".ROM"
PRINT
ON ERROR GOTO 0
RETURN
'ERROR HANDLING
IF ERR=53 THEN PRINT, "**** FILE NOT FOUND ****":CLOSE 1:RESUME 1030
IF ERR=61 THEN PRINT "**** DISK FULL ****":CLOSE I:RESUME 2030
IF ERR=67 THEN PRINT "**** DIRECTORY FULL ****":CLOSE 1:RESUME 2030
PRINT "ERROR NUMBER ";ERR;" AT LINE ";ERL :STOP
RETURN
'HEX TO DECIMAL (SA$ TO SA)
SA=O
FOR X=1 TO LEN(SA$)
FOR Y=O TO 15
IF MID$(SA$,X,l)=HEX$(Y) THEN SA=SA*16+Y
NEXT Y
NEXT X
RETURN
'HANDLE "NO FILES"
IF ERR=53 THEN PRINT "NO EPROM FILES"
RESUME NEXT

9000
9010
9020
9030
9040
9050
9060
9070
9100
9110
9120
9130
9200
9210
9220
,9230
9300
9310
9320
9330
9400
9410
9420
9430
9440
9450
9460
9500
9510
9520
9530
9999

'SET UP THE RS 232 PORT
P=5*16+8
'SET P TO PORT ADDRESS
OUT P+T,128+8+4+2+1
'GET'READY FOR BAUD MVISOR
OUT P,12:~T P+1,0
'S~ND BAUD DIVISOR
OUT P+3,8+4+2+1
'SET 8 BITS,2 STOP BITS, ODD PARITY
OUT P+5,0
'RESET FLAGS
Oll'!' P+1,0
'DISABLE ALL INTERRUPTS
RETURN
'CHECK DSR LINE (PROGRAMMER READY)
F=O
IF (INP(p+6)AND32)=32 THEN F=l
'DSR BIT IS ON
RETURN
'TOGGLE DTR LINE (SIGNAL "COMPUTER READY")
OUT P+4,INP(P+4)AND254
'TURN DTR BIT OFF
OUT P+4,INP(P+4)ORl
'TURN DTR BIT BACK ON
RETURN
'CHECK CTS LINE (PROGRAMMER ACKNOWLEDGE)
F=O
IF (INP(P+6)AND16)<>16 THEN F=1
'CTS BIT IS OFF
RETURN
'SEND DATA BYTE
'DS - DATA SEND
DR - DATA RECEIVE
IF (INP(P!f.5)AND32)<>32 THEN 9420
'WAIT FOR TX REG EMPTY
OUT P,DS
'SEND THE BYTE
IF (INP(P+5)AND 1)<> 1 THEN 9440
'WAIT FOR DATA READY
DR = INP(P)
'GET THE ECHO
RETURN
'SEND CONTROL WORD
'D -., CONTROL WORD OUT P:D'tl. b
'7,
'SEND I,T OUT
RETURN END

9

JE665 Program Modification
In order for the JE665 Program to work properly on your computer it will need to be modified. This is
necessary due to the different hardware configurations available.

The first step is to locate an unused RS·232C port and determine which chip your computer uses as an
interface for that port. You should be able to find this information in the computer's documentation. If
not, you may ask your computer dealer or contact the customer support department of your computer
manufacturer.

The chip will likely be one of the more popular ones such as:
8250
8251

ACE
USART

Asynchronous Communications Element
Universal Synchronousl Asynchronous Receiver/Transmitter

Z80 Z80 2651

SIO
DART
PCI

Serial Input/Output controller
Dual Asynchronous ReceiverlTransmitter
Programmable Communications Interface

In any case you will need some information on how to program it. The JE665 Program uses the 8250
ACE as an example.
.

Now you need to know where (what port address) your interface chip is located. This will be important
for programming. The base address should be in the range from 0 to 254. If you have a 16 bit computer
this number may be higher. There will be two or more addresses for the chip. The 8250 uses six
addresseS. At least one of these will be a transmit and/or receive register and at least one other will be
a status and/or control register.

In the chip specifications you should locate the registers and particular bits that indicate and control
each of the following:
DTR - Data Terminal Ready (computer ready)
DSR - Data Set Ready (programmer ready)
. CTS - Clear to Send (programmer acknowledge)
These lines are individually monitored and controlled by the JE665 program.

10

The program lines that you will need to modify will be in the range from 9000 to 9999. No other changes
should be needed.
.

•

Lines 9000 through 9070 set up the RS-232C port for the correct characteristics. They set the
baud rate to 9600, the number of data bits to 8, the number of stop bits to 2, and set odd parity.
They also reset all of the flags and turn off any interrupt modes the port may have. Line 9010 tells
the program that the base address of the port chip is 58H (88 decimal). You should change all of
these lines to set up your chip. If you have an 8250 then the only change necessary should be setting P to the correct base address in line 9010. Remember that these modifications need not
agree line for line with the sample program but only that each complete routine does its particular task in any way possible.

Some computers may require that you set up the port from hardware rather than software. In this
case it may be necessary to move some jumpers or change a DIP switch or two. Instructions for
this will be found in your hardware manuals.

•

The DSR (Data Set Ready) line is checked in lines 9100 to 9130. If the DSR bit is in the proper state
(1) then F is set to 1, otherwise it is set to O. Line 9120 does all the work here. It checks the DSR bit
(bit 5) of the status register on the 8250 chip. To check any bit (0-7) of a register you can use the
general statement
I F (I N P(REGADDR) AN D (2 A BIT))

= (2 A BIT) TH EN ...

This will be true if BIT is a 1. If you want to check that a bit is 0, replace the" =" \/\lith a

•

"< >"

Lines 9200 to 9230 toggle the DTR (Data Terminal Ready) line to 0 and then back to 1. They do this
by turning the DTR bit of the control register off and then back on. To turn any particular bit off
use the statement
OUT REGADDR,INP(REGADDR) AND (256-2 A BIT)
and to turn any bit on use
OUT REGADDR,INP(REGADDR) OR (2A BIT)
Change lines 9210 and 9220 to reflect your register locations and bit numbers.

•

The CTS (Clear to Send) bit is checked in line 9320 of the CHECK CTS LINE routine. If it is correct
(off) then F is set to 1, otherwise it is set to O. This routine starts at line 9300 and ends at line 9330.
Change line 9320 to reflect your chip address and bit location.

11

•

The routine that actually sends the data over the RS·232C link is from 9400 to 9460. DS is the data
to be sent. line 9420 waits for the transmitter (TX) buffer to be empty and then line 9430 sends DS
to the transmitter buffer which takes care of the rest of the transmission. Line 9340 similarly
waits for the receiver (RX) buffer to be full and then line 9350 reads the echoed data into DR. Once
again, these lines should be changed to reflect the proper addresses and bits for your chip.

•

The final routine that needs to be modified is very similar to the previous routine. D is the control
word to be sent. It is output to the transmitter register in line 9350.

Congratulations! You have finished the modifications to the JE665 Program. You can now save it as
"JE665." You can then proceed to USING THE JE665 PROGRAM.

12

Using the JE665 Program
Now you are ready to begin using the JE665 and the JE665 Program. Your first step is to be sure that
the JE664 Programmer is set up correctly. You should connect your RS-232C cable between the
programmer and the port on your computer.
There are two distinct members in an RS-232C link: the DTE (Data Terminal Equipment) and the DCE
(Data Communication Equipment). They are distinguished by the locations of the signals on the connector. Some computers act as DTE and some act as DCE. Others are hardware selectable. The JE665
is DTE.

You must be sure that all of the signals from the computer go to the proper lines on the JE665. Check
the hardware manual for your port and be sure that the DTR signal goes to pin 20 of the JE665, CTS
goes to pin 5, etc. You can change signals by pushing the pins out and swapping them on one end of
the RS-232C cable. Some common signal swaps are the transmit and receive lines (pins 2 and 3) and
the DTR and DSR lines (pins 20 and 6).

After the cable is connected with the proper lines, be sure that the programmer is plugged in and
turned on. Set the mode switch to /KEYBDI and the IPRGM PULSES/RS 2321 switch to IRS-2321. Also be
sure the IWRITE ENABLEI switch is off. Now invoke the program by typing
MBASIC JE665
A log-on message will indicate that the program is initializing. Next a menu will appear asking for the
size of EPROM you will be working with. This may easily be changed later. Press the number of your
choice. Now the main menu will appear. It will allow you to load data from the programmer or from
disk and to save data to the programmer or to disk. It will also allow you to view the data presently in
computer RAM and to enter new data. These options give you the flexibility to store, retrieve and
modify EPROM data.

For the Enter Data option, when the address appears enter the data in groups of two hex digits
by spaces. Enter a blank line to return to the main menu. This same technique will return
you from a disk command.

~Et(>arated

The rest of the program is self explanatory. Simply press the letter of your selection and answer any
questions that may be asked. If an error message appears just press any key to return to the main
menu. When you are through with the program, select option X and answer Y when asked if you are
ready to exit.

You have added a new dimension to using the JE664 EPROM Programmer. We hope you enjoy this
new flexibility.

13

.....
r----------~

-

20

1 -

READY (OTR)
!'1i\13~~1~1______________________________________________________________________________________- .

~

r'((N'\
RI~ R~O S~I
-=- WJ4IQ-I_J\'Y.j)'V~..JWv\r--H~

REC

2

1~~3~+-~

I

2B

R21
'v

XMTR

3

1----'5' .~
I~

!

!,

5~

~EADY (oSR)

3 11 5C
~
,

111

1413

32

31

30

29

26

26

20

n

-=-

~

~I

J rr

-=-

R7

410

aF-

-=-

,I.

3B

1

1

l.J:

15ue'P

"Qj!!8________-+-________________- ,

1A

C,1i2

~'~'~~------------------++.

10

sD--J

1......--~8'
I~

~

,--------1f-J'Wv\-----------------_+-------4If-------------,

1

+ SV
>R2

----'2J

4B

R6

+~~~
n:
a
I~

~
I
~CR4'~

~~_+--~--+_--~_4--_+--~----~~:~~_3_AJ4

5

?R19

1C4

1,----------------T-----=3~6AA C==k..--:"'-

7

2
SF

1

"~

~6~

1

v

140

I

1B

.---

I

~4

4 +TR
17
\l-_-'---+-+-++++--~
,~

alc
J ,----+--+-f---J

~.

I

L - J I

14

10

60)

11

210~3-------+--_+---+---__--~_+--+--4_------------~

4

3D
18

7

~17

J1

'Y

C5

R4

1aue

11

11 TR
,12

1~

RIa

CI

t_

f"

I D4A

R5V~~L;9C
-LC6

18

27

.4

ROAR

33

10 10 9____

12

ERROR
PARITY CK
DATA AVJ\AA

t

40

2

:3
-=~
~
~lofl---'2;:.;--~2';-:--2:O::;---T2U:-~8--2;:":,.-..;2,,..,~,...-;:;~'"""--'2~102~ lDS

5B

I

S
Ne

153.8KHz

17

-=-

3

RI
-A.JV\r
+ SV

UART

8

•

20

4

J\~9A 8~;~
vv +1 Vg;3

'/

I
6

III

134383738

+SV

(CTS'

AC,K \

+t

V

'1'0

91 _____~_J---t--~--~~--_+--~--------------------~'~'~'root4~cK~IR~a~4~·~_+'~
3 D2
.--_ _ _ _--"'-"1
a2 "'4'--_+~---+---+-~------------+-~W-_+_+-l
CR3
~6 7">-7------l---+---+--4_--+-~~_+---+------------'
r ______--"~4 01
U11 all!'!a'---l-'2_ _+-.
12 03
a3~
a
T8
12
4 7~5----_4--_+--~--+---~_+--~---+-------------~
2

~'

~2 7~3------+--_+---+---+---l-_+--+--~-----------------

r

3~0

6B

10

20

11

..

1

-:-'=-

+SV
8

~

7

•

5

4

3

I

1

(TO PRGM BO J4)

4 11 ::::\12

o ~

h313J~14

UART DATA CONN
J1

hI 1if:]

11

~12lho

1'1
,"CR5

13 tJ14
1 If'!

L ___~

7

•

3

I

1

2

.-:~ ~>
-

1

I +5V

:>
,>'" R13

,• Rl2R15;>
>R16
• >
~
1

8

8

7

7

1 I

I

3

~3______-I-+-'-----f, 11

r-\:;Cx>·!!.-+----!.fiLJ'~~o--f.LJil~L:~:~:: L:~:

3

13

"f,-ll~.

I

S

'712

13

11 11

SV

Rll

+lt

a~~_r_~~~~_r--~~~~f1'~~lLt--1_r--t_~r---'v~--C~~~6~.~~
8

P
'1'C9

,1,.

~ J IW
-

r:F.:l:
j[c3 ca
I

-=- -=-

I,V 2u.
+SV

,h~
OIR

•

> +8V
~R141r

CCiz~

ITO . . . . .O,,,

'L[

tV

l" to"

UART CONTROL CONN 1",2_ _>---,
J2
1

4 SG

-r

~~~~~~--~~~~--~~~~--~
(FROM HEX KEYBO)
4

tL--________

KEYBOARD CONN

1

~J3~________J1~2------------~

NOTES: UNLESS OTHERWISE NOTED
1. REFER TO COMPONENT MATERIAL LIST FOR FULL COMPONENT
VALUES AND DESCRIPTION.
2. SEE ASSEMBLY DRAWING FOR PLACEMENT OF COMPONENTS.

Appendix B -

~

P
~2
-

P

I ~ ~~~

I ih P

U----',

'----p

,Cffi~I--_~_-+-€)I

--04lm:r ~~
Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.6
Linearized                      : No
Create Date                     : 2016:11:15 09:10:32-08:00
Modify Date                     : 2016:11:15 09:15:07-07:00
XMP Toolkit                     : Adobe XMP Core 4.2.1-c041 52.342996, 2008/05/07-21:37:19
Metadata Date                   : 2016:11:15 09:15:07-07:00
Producer                        : Adobe Acrobat 9.0 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:130347b7-40c4-1f4e-9fbb-b122361c3012
Instance ID                     : uuid:d1ca42b3-dff0-fc40-b100-3f7cb063b94b
Page Layout                     : SinglePage
Page Mode                       : UseOutlines
Page Count                      : 20
EXIF Metadata provided by EXIF.tools

Navigation menu