Difference between revisions of "MagneticSensorChessBoard1987"
Jump to navigation
Jump to search
Line 32: | Line 32: | ||
# Batteryholder for 3 x AA | # Batteryholder for 3 x AA | ||
[[Category:Chess]] | [[Category:Chess]] | ||
+ | = Software = | ||
+ | == Centronics Port Check == | ||
+ | <source lang='asm'> | ||
+ | DATA SEGMENT PUBLIC 'DATA' | ||
+ | |||
+ | DATA ENDS | ||
+ | DGROUP GROUP DATA | ||
+ | ASSUME CS:ADDS,DS:DGROUP,SS:DGROUP | ||
+ | |||
+ | ADDS SEGMENT 'CODE' | ||
+ | PUBLIC CheckBrett,Sound | ||
+ | |||
+ | Sound PROC FAR ; Freq,Time: INTEGER; | ||
+ | PUSH BP | ||
+ | MOV BP,SP | ||
+ | PUSH DI | ||
+ | MOV DI,8[BP] ; Freq; | ||
+ | MOV BX,6[BP] ; Time; | ||
+ | |||
+ | MOV AL,0B6H ; Zeitgeber Modus-Register schreiben | ||
+ | OUT 43H,AL | ||
+ | MOV DX,14H ; Zeitgeber Divisor = | ||
+ | MOV AX,4F38H ; 1331000/Frequenz | ||
+ | DIV DI | ||
+ | OUT 42H,AL ; Zaehler in niederw. Byte Timer 2 | ||
+ | MOV AL,AH | ||
+ | OUT 42H,AL ; Zaehler in hoeherw. Byte Timer 2 | ||
+ | IN AL,61H ; Aktuelle Einstellung Port B | ||
+ | MOV AH,AL ; In AH Sichern | ||
+ | OR AL,3 ; Lautsprecher einschalten | ||
+ | OUT 61H,AL | ||
+ | |||
+ | Warte: | ||
+ | MOV CX,2801 ; 10 Millisekunden warten | ||
+ | |||
+ | LS_Ein: | ||
+ | LOOP LS_Ein | ||
+ | DEC BX ; Einschaltzaehler auf 0? | ||
+ | JNZ Warte ; wenn nicht Lautsprecher anlassen | ||
+ | |||
+ | MOV AL,AH ; Port wiederherstellen | ||
+ | OUT 61H,AL | ||
+ | |||
+ | |||
+ | POP DI | ||
+ | POP BP | ||
+ | RET 4 | ||
+ | Sound ENDP | ||
+ | |||
+ | CheckBrett PROC FAR ;d,l: INTEGER: BOOLEAN | ||
+ | PUSH BP | ||
+ | MOV BP,SP | ||
+ | CLI | ||
+ | MOV AX,8[BP] ; d | ||
+ | MOV CX,6[BP] ; l | ||
+ | MOV DX,0278h | ||
+ | OUT DX,AL ; Port[Data]:=D | ||
+ | INC DX | ||
+ | IN AL,DX | ||
+ | XCHG AL,CL | ||
+ | DEC DX | ||
+ | OUT DX,AL ; Port[Data]:=l | ||
+ | STI | ||
+ | MOV AX,0 | ||
+ | AND CL,080h | ||
+ | JNZ FALSE | ||
+ | |||
+ | INC AX | ||
+ | |||
+ | FALSE: | ||
+ | |||
+ | POP BP | ||
+ | RET 4 | ||
+ | |||
+ | CheckBrett ENDP | ||
+ | |||
+ | |||
+ | ADDS ENDS | ||
+ | END | ||
+ | � | ||
+ | </source> |
Revision as of 05:39, 21 October 2019
Hardware
Front
Back
Connectors
Schematics
Parts:
Partlist
- chess plan 35 mm fields
- 64 Reed Contacts
- 16 Black Chess Pieces
- 16 White Chess Pieces
- 32 magnets
- 17 red LEDs
- On/Off switch
- Male Sub-D Connector 15
- Adapter cable Centronics - SUB-D 15 Female
- Copper Tape
- Aluminum Frame
- 1 TTL 74151
- 1 TTL 74154
- 330 Ohm Resistor
- Batteryholder for 3 x AA
Software
Centronics Port Check
DATA SEGMENT PUBLIC 'DATA'
DATA ENDS
DGROUP GROUP DATA
ASSUME CS:ADDS,DS:DGROUP,SS:DGROUP
ADDS SEGMENT 'CODE'
PUBLIC CheckBrett,Sound
Sound PROC FAR ; Freq,Time: INTEGER;
PUSH BP
MOV BP,SP
PUSH DI
MOV DI,8[BP] ; Freq;
MOV BX,6[BP] ; Time;
MOV AL,0B6H ; Zeitgeber Modus-Register schreiben
OUT 43H,AL
MOV DX,14H ; Zeitgeber Divisor =
MOV AX,4F38H ; 1331000/Frequenz
DIV DI
OUT 42H,AL ; Zaehler in niederw. Byte Timer 2
MOV AL,AH
OUT 42H,AL ; Zaehler in hoeherw. Byte Timer 2
IN AL,61H ; Aktuelle Einstellung Port B
MOV AH,AL ; In AH Sichern
OR AL,3 ; Lautsprecher einschalten
OUT 61H,AL
Warte:
MOV CX,2801 ; 10 Millisekunden warten
LS_Ein:
LOOP LS_Ein
DEC BX ; Einschaltzaehler auf 0?
JNZ Warte ; wenn nicht Lautsprecher anlassen
MOV AL,AH ; Port wiederherstellen
OUT 61H,AL
POP DI
POP BP
RET 4
Sound ENDP
CheckBrett PROC FAR ;d,l: INTEGER: BOOLEAN
PUSH BP
MOV BP,SP
CLI
MOV AX,8[BP] ; d
MOV CX,6[BP] ; l
MOV DX,0278h
OUT DX,AL ; Port[Data]:=D
INC DX
IN AL,DX
XCHG AL,CL
DEC DX
OUT DX,AL ; Port[Data]:=l
STI
MOV AX,0
AND CL,080h
JNZ FALSE
INC AX
FALSE:
POP BP
RET 4
CheckBrett ENDP
ADDS ENDS
END
�