Beruflich Dokumente
Kultur Dokumente
CONTENTS
PAGE NO
1.0 Introduction 2
3.0 Installation 3
Appendix C : Calibration
1.0 INTRODUCTION
Electro Systems Associates Private Limited (ESA) manufactures trainers for most of the popular
microprocessors viz 8085, Z-80, 6502, 8031, 8086/88 and 68000. ESA offers a variety of modules
which can be interfaced to these trainers. These modules can be effectively used for
teaching/training in the laboratories.
An Analog to Digital Converter is the basic interface between real world analog signals, and digital
systems such as microprocessors, computers and so on. The typical accuracy and resolution
requirements of almost all industrial and laboratory measurements are fully met by a 12 bit ADC.
A 12 Bit ADC Interface is offered by Electro Systems Associates, with an optional analog
multiplexer. The analog multiplexer enables data from up to eight different analog sources to be
acquired. This interface can accept either unipolar signals in the range 0 to 10 V, or bipolar signals
of -5V to +5V or -10V to +10V. By adding a single resistor in shunt with the input, current signals
of 0 to 20 mA or 4 to 20 mA can also be directly handled by this interface.
This interface is built around the industry standard fast ADC, AD1674 with built in reference, clock
and sample-hold circuit which does a conversion in as little as 10 micro sec. As such even transients
lasting for only a few milliseconds can be captured and stored using this interface. This interface
can be directly coupled to the Programmable Peripheral Interface Device, 8255 on any of the ESA
trainers. This opens up a wide range of applications to the users of these trainers, in the field of
analog measurements, transducer interfacing, Industrial monitoring and so on.
Jumper JP1 decides whether the interface is intended for single channel or 8 channel operation. When
single channel operation is intended, no multiplexer is used and JP1 is open. Input is applied to
Screw terminal TP.
When 8 channel operation is desired JP1 is in closed condition. The multiplexer is populated and
eight channels are available as selected by channel select lines connected to PC2 through PC5 of
the 8255 on the corresponding trainer. Input signals are applied to screw terminals CH0 through
CH7. Note that in 8 channel mode, input should not be applied to screw terminal TP. The
multiplexed signal can however be monitored at this terminal. The channel selection is as shown in
Table I.
TABLE I
The converted data DB0 through DB11 is latched at the end of conversion in to latches 74LS374
(U5 and U6). PC0 controls the condition of these latches. When PC0 is high the outputs of the
latches are tristated. When PC0 is low, data is available at port bits PA0 through PA7 and PB0
through PB3. This 8 scheme enables the user to expand the system to 16 channel utilizing the same
PPI Ports PA and PB for yet another 12 bit ADC interface.
Port bit PC1 is used to command conversion. A high to low transition initiates a conversion and STS
of ADC goes high indicating that ADC is busy. At the end of the conversion, the STS line goes
low. This transition is used to strobe the converted data in to the latches U5 and U6.
This interface can be operated with inputs of 0 to 10V, -5V to +5V or -10V to +10V. This is
determined by the location of shorting plugs in the jumpers JP3 and JP2. Details are as in Table II.
TABLE II
3.0 INSTALLATION
The interface is housed in a plastic enclosure which has a locking mechanism. To open the cover,
push the locking mechanism with the finger and lift the cover to open.
The interface module has a 26-pin connector at one edge of the card. This is used for connecting the
interface to the trainer with a flat cable connector set. External power supplies +12V and -12V are
connected to points marked +12V and -12V respectively on the ADC card.
Table 3-1 shows the connectors on various trainers to which this interface can be connected. Some
trainers have two connectors to which this interface can be connected. The demonstration programs
presented in this manual assume that the interface is connected to connector shown in column A. If
the connectors shown in column B are used, then user has to change the port addresses
appropriately. User may refer to component layout diagrams of respective ESA trainer to locate
the connectors mentioned here.
TABLE-3.1
MICROPROCESSOR A B
TRAINER
MPS 85-3 J2 J1
ESA 85-2 J2 J1
ESA-80 J2 J1
ESA-65 P4
ESA-68K P3 P4
ESA 68K-2 J2 J1
ESA 68-2 J1 J6
ESA 196 J1 J2
ESA-31 J2 J1
ESA-51 J10 J7
ESA-51E J5 J3
ESA-86/88-2 J4 J5
ESA-86/88-3 J8 J9
ESA-86/88E J4 J6
In keyboard mode, if we press 'NEXT' key & 'PREV' key, we can get the channel increment &
decrement respectively. Press 'EXEC' key to come to the monitor. In serial mode, if we press ','key &
'-' key, we can get the channel increment & decrement respectively. Press <CR> to come to serial
monitor.
;decrement
889D FE 1D CPI 1DH ;Is it "EXEC" key
889F C2 90 88 JNZ S3 ;No try again
88A2 EF RST 5 ;Go to serial
;monitor routine
88A3 3A 00 90 CHDCR: LDA 9000H ;Move channel
;value to Acc
88A6 3D DCR A ;decrement and jump
88A7 C3 AE 88 JMP S4
88AA 3A 00 90 CHINR: LDA 9000H ;Move channel
;value to Acc
88AD 3C INR A ;increment
;channel value
88AE E6 07 S4: ANI 07H ;Comparing for
;eight channels
88B0 32 00 90 STA 9000H ;Store current
;channel value
88B3 C3 0D 88 JMP CONVERT ;Jump to convert
;channel value
88AE E6 07 S4: ANI 07H ;Comparing for
;eight channels
88B0 32 00 90 STA 9000H ;Store current
;channel value
88B3 C3 0D 88 JMP CONVERT ;Jump to convert
80F8 00 NOP
80F9 00 NOP
80FA 02 80 20 LJMP BACK
ORG $40600
40600 45 F9 00 START: LEA.L $80300,A2 ;Port A
08 03 00
40606 47 F9 00 LEA.L $80302,A3 ;Port B
08 03 02
4060C 49 F9 00 LEA.L $80304,A4 ;Port C
08 03 04
40612 4B F9 00 LEA.L $80306,A5 ;Control
08 03 06 ;port
40618 10 3C 00 MOVE.B #$92,D0 ;Initialise
92 ;8255 port
4061C 1A 80 MOVE.B D0,(A5)
4061E 10 3C 00 MOVE.B #03,D0
03
40622 18 80 MOVE.B D0,(A4)
40624 42 80 CONVERT: CLR.L D0
40626 10 39 00 MOVE.B CHA,D0
04 07 02
4062C E5 18 ROL.B #2,D0
4062E 00 00 00 ORI.B #$23,D0
23
40632 18 80 MOVE.B D0,(A4) ;Enable Mux
;through PC5
40634 60 00 00 BRA.L SETLTIME
FC
40638 76 04 BACK: MOVEQ.L #4,D3
4063A 41 F9 00 LEA.L CTLBYT,A0
04 06 FE
40640 1A 98 LOAD: MOVE.B (A0)+,(A5)
40642 53 43 SUBQ.W #1,D3
40644 0C 03 00 CMPI.B #0,D3
00
40648 66 F6 BNE.S LOAD
4064A 10 12 MOVE.B (A2),D0 ;High Port A
04 03 54
406B2 70 04 MOVEQ.L #4,D0
406B4 4E B8 00 JSR.S $008C
8C
406B8 4C 9F 00 MOVEM.W (A7)+,D0-D2
07 ;Restore
406BC 4E B8 03 JSR.S $0304
04 ;Send crlf
406C0 4E B8 04 GETCHR: JSR.S $04E0 ;Get one char
E0 ;from console
406C4 0C 01 00 CMPI.B #$2C,D1 ;Is it
2C ;','key
406C8 67 00 00 BEQ.L CHINR ;Yes - go
1E ;to channel
;increment
406CC 0C 01 00 CMPI.B #$2D,D1 ;Is it
2D ;'-' key
406D0 67 00 00 BEQ.L CHDCR ;Yes - go
0A ;to channel
;decrement
406D4 0C 01 00 CMPI.B #$0D,D1 ;Is it
0D ;'CR' key
406D8 66 E6 BNE.S GETCHR ;No, try again
406DA 4A FC DC.W $4AFC ;Return to
;monitor
406DC 10 39 00 CHDCR: MOVE.B CHA,D0
04 07 02
406E2 53 00 SUBQ.B #1,D0
406E4 60 00 00 BRA.L S4
0A
406E8 10 39 00 CHINR: MOVE.B CHA,D0
04 07 02
406EE 52 40 ADDQ.W #1,D0
406F0 02 40 00 S4: AND.W #07,D0
07
406F4 13 C0 00 MOVE.B D0,CHA
04 07 02
406FA 60 00 FF BRA.L CONVERT
2C 28
406FE 02 03 CTLBYT: DC.W $0203
00 00 DC.W $0000
40702 00 00 CHA: DC.W $0000
40704 00 00 DC.W $0000
40706 00 00 DIG1:DC.W $0000
40708 00 00 DIG2:DC.W $0000
ORG 0:2000H
;Initialised
;PC1, PC0 are high
2016 4A DECW DX ;High port C.
2017 4A DECW DX
2018 EE OUTB DX
2019 A0 E0 20 CONVERT: MOVB AL,CHA ;Get channel value
201C B1 02 MOVB CL,#02H
201E D2 C0 ROLB AL,CL ;Rotate twice
2020 0C 23 ORB AL,#23H ;Enable mux
;through PC5.
2022 BA E4 FF MOVW DX,#0FFE4H
2025 EE OUTB DX
2026 51 PUSH CX
2027 B9 01 00 MOVW CX,#0001H ;SETLTIME delay
202A E2 FE LOOP 202AH
202C 59 POP CX
202D B0 02 MOVB AL,#02H ;8255 Bit set mode
202F 42 INCW DX
2030 42 INCW DX
2031 EE OUTB DX
2032 FE C0 INCB AL
2034 EE OUTB DX
2035 B0 00 MOVB AL,#00H ;Start Conversion
2037 EE OUTB DX
2038 90 NOP
2039 90 NOP
203A 90 NOP
203B BA E0 FF MOV DX,#0FFE0 ;High port A
203E EC INB DX ;Read lower
;byte data.
203F A2 E2 20 MOVB DIG2,AL ;Store digital
;values.
2042 42 INCW DX
2043 42 INCW DX ;High port B
2044 EC INB DX ;Read higher
;byte data.
2045 A2 E1 20 MOVB DIG1,AL ;Store digital
;values
2048 BA ED FF MOVW DX,#0FFED ;Read DIP switch
204B EC INB DX
204C 24 80 ANDB AL,#80 ;Find mode of
;operation
204E 74 4E JE KBD ;Keyboard mode
2050 8C C8 SERIAL: MOVW AX,CS ;Offset of string
2052 8E C0 MOVW ES,AX ;Input (ES) segment
;where string is
;located
2054 B8 E3 20 MOVW AX,#CHAMSG
2057 9A 55 1B 00 FE CALLS 1B55,0FE00;Display routine
205C A0 E0 20 MOVB AL,20E0
205F 9A 64 1B 00 FE CALLS 1B64,0FE00;Output a byte
;to console
2064 9A 60 1B 00 FE CALLS 1B60,0FE00
2069 8C C8 MOVW AX,CS ;Offset of string
206B 8E C0 MOVW ES,AX ;Input (ES) segment
;where string is
;located
206D B8 EF 20 MOVW AX,#20EF
2070 9A 55 1B 00 FE CALLS 1B55,0FE00;Display routine
2075 A0 E2 20 MOVB AL,20E2
2078 8A 26 E1 MOVB AH,20E1 ;Get digital
20 ;value
207C 9A 69 1B 00 FE CALLS 1B69,0FE00
2081 9A 5B 1B 00 FE CALLS 1B5B,0FE00;<CR>
2086 9A 5B 1B 00 FE CALLS 1B5B,0FE00
208B 90 S2: NOP
208C 9A 70 1B 00 FE CALLS 1B70,0FE00;Get key code
2091 3C 2C CMPB AL,#2C ;Is it "," key
2093 74 3E JE CHINR ;Yes go to channel
;increment
2095 3C 2D CMPB AL,#2D ;Is it "-" key
2097 74 32 JE CHDCR ;Go to channel
;decrement
2099 3C 0D CMPB AL,#0D
209B 75 EE JNE S2
209D CC INT 3 ;Return to monitor
209E A0 E0 20 KBD: MOVB AL,CHA
20A1 B4 00 MOVB AH,#00
20A3 9A 0A 0B 00 FF CALLS 0B0A,0FF00
20A8 8A 26 E1 20 MOVB AH,DIG1
20AC A0 E2 20 MOVB AL,DIG2
20AF BB 00 01 MOVW BX,#0100 ;In address field
;No prompt
20B2 B1 00 MOVB CL,#00 ;No leading
;blanking
20B4 9A 12 0B 00 FF CALLS 0B12,0FF00 ;Displays
;Digital no.
20B9 9A 1C 0B 00 FF CALLS 0B1C,0FF00 ;Read a keycode
20BE 3C 11 S3: CMPB AL,#11 ;Is it "NEXT" key
20C0 74 11 JE CHINR
8099 00
809A 20 20 20 20 20 DIGITAL: DB 'DIG. VALUE= ',00h,0DH,0AH
809F 20 44 49 47 2E
80A4 20 56 41 4C 55
80A9 45 3D 20 00 0D
80AE 0A
80AF 00 SETLTIME: NOP
80B0 00 NOP
80B1 00 NOP
80B2 00 NOP
80B3 00 NOP
80B4 00 NOP
80B5 00 NOP
80B6 00 NOP
80B7 00 NOP
80B8 00 NOP
80B9 02 80 20 LJMP BACK
80BC 75 A0 E9 GETKEY: MOV P2,#0E9H
80BF 78 04 MOV R0,#04H
80C1 E2 MOVX A,@R0
80C2 30 E3 05 JNB ACC.3,L1
80C5 12 01 61 LCALL GETKB
80C8 80 03 SJMP L2
80CA 12 12 BB L1: LCALL GETCH
80CD 22 L2: RET
80CE 75 A0 E9 OUTCHAN: MOV P2,#0E9H
80D1 78 04 MOV R0,#04H
80D3 E2 MOVX A,@R0
80D4 30 E3 03 JNB ACC.3,SRL1
80D7 12 03 BB LCALL CLRLCD
80DA 90 80 8F SRL1: MOV DPTR,#CHANNEL
80DD C2 D5 CLR 0D5H
80DF 12 04 04 LCALL OUTPUT ;Display
;"channel ="
80E2 22 RET
; the interface.
; To increment channel value, the user has to enter ','
; To decrement channel value, the user has to enter '-'
; The program starts at memory location 0:2500H
; Please refer ESA 86/88-3 user's manual for mnemonic syntax
; suitable to trainer
211E 56 41 4C 55 45 20 DB 56H,41H,4CH,55H,45H,
2124 3D 20 00 20H,3DH,20H,00H
APPENDIX C
CALIBRATION
Short jumper JP3 at BC, keep JP1 and JP2 open. The first output transition (from 0000 0000 0000 to
0000 0000 0001) should nominally occur for an input level of 1 LSB (1.22mV above ground for
10V range). To trim unipolar offset to this nominal value, apply a 1 LSB signal between PIN 13
and ground (10V range) and adjust VR3 until the first transition is located. The full-scale trim is done
by applying a signal 1 LSB below the nominal full-scale (9.9963V for 10V range) and adjusting
VR1 until the last transition is located (1111 1111 1110 to 1111 1111 1111).
Short jumper JP3 at AB, keep JP1 and JP2 open. To trim bipolar offset to its nominal value, supply
PIN 13 with a signal LSB below midrange (-1.22mV for a 5V range) and adjust VR2 until the
major carry transition is located (0111 1111 1111 to 1000 0000 0000). To trim full-scale (+4.9963V
for a 5V range) and adjust VR1 to give the last positive transition (1111 1111 1110 to 1111 1111
1111) these trims are interactive so several iterations may be necessary to convergence.