5
HARDWARE DESCRIPTION
KEYPAD INTERFACE
When a connection is made between an X and Y axis, the
P3.3/INT1 line will be brought low and will stay low as long as
a key is pressed, signaling that a value may be read from the
KEYPAD port. The chart shows what hex number will be
returned. The value should be ANDed with 00011111b to
mask off the unused bits.
A key closure may be detected by polling P3.3, or by a better
method which involves enabling the pin's INT1 function and
configuring it to sense a negative transition. This is done as
follows:
KEYPAD CN4
o Y5
1
o
X4
o
X3
o
X2
o
X1
o
Y4
o
Y3
o
Y2
o
Y1
o
GND
9
RETURN VALUES
X1 X2 X3 X4
00
01
02
03
Y1
04
05
06
07
Y2
08
09
0A
0B
Y3
0C
0D
0E
0F
Y4
10
11
12
13
Y5
CLR
P5.1
; ENABLE MMIO
SETB
TCON.2
; INT1 IS FALLING EDGE SENSITIVE
CLR
IEN0.2
; DISABLE INT1, FROM VECTORING (INT FLAG..
; STILL GETS SET ON FALLING EDGE THOUGH)
A subroutine may be written which waits for a key to be pressed and returns the value in A, like the following:
GETKEY:
JNB
TCON.3,GETKEY
; LOOP TILL TRANSITION SENSED
MOV
DPH,KEYPORT
; POINT TO KEYPAD PORT
MOVX
A,@DPTR
; GET THE KEY
ANL
A,00011111B
; MASK OFF UNUSED BITS
CLR
TCON.3
; CLEAR INT1 EDGE FLAG
RET
DIGITAL TO ANALOG CONVERTER
The D/A converter has four channels of eight bit resolution with
0 to 5 volt analog output range. Writing to ports 10 to 13 hex will
write to channels A, B, C, and D respectively. Writing 0 to a port
causes 0V to be output and writing FF hex causes 5V to be
output.
+Vin is the unregulated DC that is applied to ST1 and PX9 is a
port line which can be programmed as a digital input or output,
or an interrupt line.
LCD INTERFACE
D/A HDR2
1
2
+VIN
o o
GND
VOUTA
o o
GND
VOUTB
o o
GND
VOUTC
o o
GND
VOUTD
o o
GND
PX9
o o
GND
11
12
The LCD interface allows the MicroPac to control OPTREX
and compatible LCD panels. The power for LED
backlighting may be turned on by setting OP7. The
contrast level may be controlled by a fixed resistor on the
MicroPac or by a remote potentiometer. See the
distribution disk's assembly language drivers for
programming examples.
LCD PANEL HDR5
1
2 VCC
o o
GND
RS
o o
CONTRAST
E
o o
R/W*
D1
o o
DO
D3
o o
D2
D5
o o
D4
D7
o o
D6
BACKLIGHT K
o o
BACKLIGHT A
15
16
Содержание MicroPac 535
Страница 22: ...APPENDIX D MicroPac 535 Schematics...
Страница 23: ......
Страница 24: ......
Страница 25: ......
Страница 26: ......