a4: Bearbeitung Praktikum
This commit is contained in:
parent
a5ba2e5277
commit
bcef249f6a
|
@ -18,7 +18,7 @@ frei db 'frei ', 0 ; Texte
|
||||||
belegt db 'belegt ', 0
|
belegt db 'belegt ', 0
|
||||||
|
|
||||||
; Konstanten
|
; Konstanten
|
||||||
??? equ 0 ; Platzhalter fuer Ihre Zeitkonstante1
|
divider equ 0 ; Platzhalter fuer Ihre Zeitkonstante1
|
||||||
????? equ 0 ; Platzhalter fuer Ihre Zeitkonstante2
|
????? equ 0 ; Platzhalter fuer Ihre Zeitkonstante2
|
||||||
VE_aktiv equ 1 << 0 ; Vereinzeler bzw. Verzoegerung aktiv
|
VE_aktiv equ 1 << 0 ; Vereinzeler bzw. Verzoegerung aktiv
|
||||||
intab0 equ 20h ; Adresse Interrupttabelle PIT, Kanal 1
|
intab0 equ 20h ; Adresse Interrupttabelle PIT, Kanal 1
|
||||||
|
@ -53,13 +53,13 @@ keybd equ 80h ; SBC-86 Tastatur
|
||||||
gokey equ 11h ; Taste "GO"
|
gokey equ 11h ; Taste "GO"
|
||||||
outkey equ 15h ; Taste "OUT"
|
outkey equ 15h ; Taste "OUT"
|
||||||
sseg7 equ 9eh ; Segmentanzeige 7
|
sseg7 equ 9eh ; Segmentanzeige 7
|
||||||
tcpwm equ ??? ; 1843200 Hz / ??? = ca. 10000 Hz = 0.1 ms
|
tcpwm equ 184 ; 1843200 Hz / 184 = ca. 10000 Hz = 0.1 ms
|
||||||
; Taktzyklus
|
; Taktzyklus
|
||||||
; Zeitkonstante fuer PWM-Interrupt
|
; Zeitkonstante fuer PWM-Interrupt
|
||||||
tpwm equ 200 ; Periodendauer des PWM-Signals * 0.1 ms
|
tpwm equ 200 ; Periodendauer des PWM-Signals * 0.1 ms
|
||||||
tlinks equ 10 ; Impulsdauer fuer "ZU" * 0.1 ms
|
tlinks equ 10 ; Impulsdauer fuer "ZU" * 0.1 ms
|
||||||
trechts equ 20 ; Impulsdauer fuer "AUF" * 0.1 ms
|
trechts equ 20 ; Impulsdauer fuer "AUF" * 0.1 ms
|
||||||
tcwait equ ????? ; 1843200 Hz / ????? = 100 Hz => 10 ms
|
tcwait equ 18432 ; 1843200 Hz / 18432 = 100 Hz => 10 ms
|
||||||
; Zeitkonstante fuer Wartezeitinterrupt
|
; Zeitkonstante fuer Wartezeitinterrupt
|
||||||
twait equ 1 ; Wartezeit fuer offenen Vereinzeler (s)
|
twait equ 1 ; Wartezeit fuer offenen Vereinzeler (s)
|
||||||
shcnt equ 4 ; Shiftcount Anzahl Teile
|
shcnt equ 4 ; Shiftcount Anzahl Teile
|
||||||
|
@ -92,10 +92,13 @@ again:
|
||||||
times shcnt shr ax, 1
|
times shcnt shr ax, 1
|
||||||
|
|
||||||
cmp ax, 0x0
|
cmp ax, 0x0
|
||||||
jle ifzero
|
jz ifzero
|
||||||
|
|
||||||
|
cmp ax, 0x8
|
||||||
|
ja ifbelowzero
|
||||||
|
|
||||||
cmp ax, 0x0
|
cmp ax, 0x0
|
||||||
jnz ifnotzero
|
ja ifnotzero
|
||||||
|
|
||||||
jmp again
|
jmp again
|
||||||
|
|
||||||
|
@ -107,12 +110,16 @@ ifnotzero:
|
||||||
|
|
||||||
jmp again
|
jmp again
|
||||||
|
|
||||||
ifzero:
|
ifzero:
|
||||||
mov ah, ascii
|
mov ah, ascii
|
||||||
mov dl, 7
|
mov dl, 7
|
||||||
mov bx, belegt
|
mov bx, belegt
|
||||||
int conout
|
int conout
|
||||||
|
|
||||||
|
jmp again
|
||||||
|
|
||||||
|
ifbelowzero:
|
||||||
|
|
||||||
mov dx, pieces << shcnt
|
mov dx, pieces << shcnt
|
||||||
and dx, 10000001b
|
and dx, 10000001b
|
||||||
mov [status], dx
|
mov [status], dx
|
||||||
|
@ -186,7 +193,17 @@ init:
|
||||||
|
|
||||||
isr_opentimer: ; Timer fuer Vereinzeler (Zeit fuer Oeffnung)
|
isr_opentimer: ; Timer fuer Vereinzeler (Zeit fuer Oeffnung)
|
||||||
push ax
|
push ax
|
||||||
|
|
||||||
; Ihr Programmcode
|
; Ihr Programmcode
|
||||||
|
;Zeit abgelaufen ?
|
||||||
|
inc byte [divider]
|
||||||
|
cmp byte [divider], tcountv
|
||||||
|
jne isr_opentimer_out
|
||||||
|
|
||||||
|
mov ax, [status]
|
||||||
|
and ax, 11111110b
|
||||||
|
mov [status], ax
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
isr_opentimer_out: ; Ausgang aus dem Service
|
isr_opentimer_out: ; Ausgang aus dem Service
|
||||||
|
@ -219,14 +236,20 @@ isr_lt_out: ; Ausgang aus dem Service
|
||||||
|
|
||||||
isr_servotimer: ; Timer fuer Servo (Vereinzeler)
|
isr_servotimer: ; Timer fuer Servo (Vereinzeler)
|
||||||
push ax
|
push ax
|
||||||
|
push bx
|
||||||
; Ihr Programmcode
|
; Ihr Programmcode
|
||||||
|
mov bl, [status]
|
||||||
|
and bl, 11111110b
|
||||||
|
|
||||||
|
cmp bl, 0x0
|
||||||
|
jz auf
|
||||||
|
|
||||||
|
jmp isr_servotimer_out
|
||||||
|
|
||||||
|
|
||||||
isr_servotimer_out: ; Ausgang aus dem Service
|
isr_servotimer_out: ; Ausgang aus dem Service
|
||||||
mov al, eoi ; EOI an PIC
|
mov al, eoi ; EOI an PIC
|
||||||
out ocw_2_3, al
|
out ocw_2_3, al
|
||||||
|
pop bx
|
||||||
pop ax
|
pop ax
|
||||||
iret
|
iret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue