• Non ci sono risultati.

Interfaccia del Timer1

N/A
N/A
Protected

Academic year: 2022

Condividi "Interfaccia del Timer1"

Copied!
17
0
0

Testo completo

(1)
(2)

Interfaccia del Timer1

I/O AB I/O DB I/O CB

Dec

SELECT

START

IRQ

SCO R Q

S Q STATUS

STARTDEV

COMPLETE

CLEAR

IVN

CPU

IACKIN

IACKOUT

IRQ

IOWR

REG

COUNTER

DEC

TC

R Q S Q

IM

SETIM CLRIM

LD

LD

OR

Non strettamente neces- Non strettamente neces- sario TIMER1 è non sario TIMER1 è non

interrompibile

interrompibile

(3)

Interfaccia del Timer2 (parte 1)

I/O AB I/O DB I/O CB

Dec

SELECT

START

IRQ

SCO R Q

S Q STATUS

STARTDEV

COMPLETE

CLEAR

IVN

CPU

IACKIN

IACKOUT

IRQ

IOWR

REG

COUNTER

DEC

TC

R Q S Q

IM

SETIM CLRIM

LD

LD

OR

(4)

Interfaccia del Timer2 (parte 2)

I/O AB I/O DB I/O CB

Dec

SELECT

SCO

CPU

IACKOUT

IORD

REG

IRQ

(5)

Il codice

; TIMER1: I/O=O, ind=30h, IVN=1

; TIMER2: I/O=O, ind=31h, IVN=2

org 400h ;INIZIO PROGRAMMA timer1 equ 30h ;indirizzo timer1 timer2 equ 31h ;indirizzo timer2

synch equ aaaah ; byte di sincronizzazione

initT1 equ bbbbh ; indirizzo valore inizializzazione timer1 initT2 equ CCCCh ; indirizzo valore inizializzazione timer2 buffer equ DDDDh ; indirizzo buffer importazione da timer2

code ;inizio istruzioni jsr init ;inizializzazione

seti ;abilita PD32 ad accettare interruzioni main: ; .... progr. principale

(6)

Il codice

init: movb #0, synch outb initT1, timer1 outb initT2, timer2 start timer1

start timer2

setim timer1 ;abilita periferica TIMER1 a generare interruzioni setim timer2 ;abilita periferica TIMER2 a generare interruzioni ret

;DRIVER T1

driver 1, 600h Il driver della periferica con IVN=1 inizia dall'ind. 600h movb #1, synch

start timer1 ;

rti ;ritorno da interruzione

;FINE DRIVER TIMER1

;DRIVER T2

driver 2, 700h ;Il driver della periferica con IVN=2 inizia dall'ind. 700h push r0 ;

clrim timer2 ; maschera il flip-flop im di timer2 per evitare stack-overflow seti ; rende il processore interrompibile

(7)

Il codice

movb synch, r0 ;

cmpb #0, r0 ;

jz import;

movb #0, synch start timer2;

setim timer2 pop r0;

rti

import: inl timer2,buffer jsr init

pop r0;

rti

;FINE DRIVER TIMER2 end

(8)
(9)

Interfaccia del DEVICE (timer)

I/O AB I/O DB I/O CB

Dec

SELECT

START

IRQ

SCO R Q

S Q STATUS

STARTDEV

COMPLETE

CLEAR

IVN

CPU

IACKIN

IACKOUT

IRQ

IOWR

REG

COUNTER

DEC

TC

R Q S Q

IM

SETIM CLRIM

LD

LD

OR

(10)

Interfaccia DEV_TEMP

I/O DB I/O CB

SELECT

REG

I/O RD

CPU

I/O WR

RESET

I/O AB

Termometro

(11)

Interfaccia DMAC

(12)

Logica dell’interfaccia del DMAC per le interruzioni

I/O AB I/O DB I/O CB

Decoder

SELECT

START

STARTD

O.C.

IRQ

SCO DMAC R Q

S Q STATUS

STARTDEV

COMPLETE CLEAR

IVN

CPU

IACKIN

IACKOUT

IRQ

(13)

PD32 DB CB

I/ O D B I/ O C B

I/ O A B

MEMORIA

SELECT

I/O WR

CAR INC

WC I/O WR

SCO DMAC

DECR TC

MBR F/F Q

O.C.

MBR

MBG

SCO VIDEO

DATO SCRITTO NEXT DATO

REG VIDEO REG

MRD

32 bit

32 bit

STATUS F/F

AB

IR Q

LD

(14)

• CMPB R1,R2

Equivale ad eseguire R2-R1 senza aggiornare R2

CMPB R1,R2

R2-R1=0 (R1=R2)

Z=1 N=V

R2-R1>=0 (R2>=R1)

Z=0

R1<=R2

R1>R2

N=V R2>=R1 N<>V  R2<=R1 Z=1  R1=R2 Z=0  R1<>R2 N<>V

R1<>R2

Z=0

Confronto fra registri

Aritmetica segnata

R1,R2 rappresentati in complemento a 2

Z=0

R1<R2

(15)

Inizializzazione timer

; subroutine di inizializzazione parametrica, richiede il caricamento in R0 del numero

;di millisecondi dell’intervallo init: outb R0, DEVICE

start DEVICE ret

(16)

Driver timer

DRIVER 1,600h PUSH R0

INB DEVTEMP, R0 CMPB R0,#40

JN N_EQ_1 N_EQ_0:JNV NV_EQ

JMP NV_DIF N_EQ_1:JV NV_EQ

JMP NV_DIF NV_EQ: START DEVICE

POP R0 RTI

NV_DIF: CLRIM DEVICE

OUT #512, WCOUNTER ; inizializza il WCOUNTER OUT #BBBBh,CAREGISTER ; passa il valore al CAR

START DMAC ;avvia trasferimento

POP R0 RTI

(17)

Driver DMAC

DRIVER 2,700h

SETIM DEVICE START DEVICE CLEAR DMAC RTI

Riferimenti

Documenti correlati

avvisare direttamente, nei casi ritenuti più gravi (per assenze, ritardi, rendimento scolastico carente) telefonicamente o per iscritto la famiglia dei ragazzi;

L’attività di manutenzione, collegata al mantenimento della sicurezza ed efficienza degli impianti, così come l’affidamento di queste attività ad imprese terze deve far parte

The high lithium abundance for this and the high estimates of 6 Li/ 7 Li ratio ( 0.5) can be explained by the 6 Li production due to spal- lation reactions and preservation of

diminuiscono per tutte le classi di comuni con popolazione residente &lt; 10.000 abitanti anche rispetto alle sole Entrate attività edilizia destinate a spese per

SaNIS - Scuola Di Nutrizione ed Integrazione per lo Sport [ 20/04/2015 ] Indirizzo: Palermo. Corso “Nutrizione e supplementazione nello sport per

Gradi 55 - 00143 Roma romalaurentino@postacert.inali.it Agenzia di Nettuno

L’Azienda stabilisce piani e programmi di attuazione degli obiettivi nei quali fissa le priorità di realizzazione degli obiettivi stessi tenendo conto degli esiti della valutazione

Si informa, inoltre, che la persona con disabilità da lavoro suindicata, ai fini della sua adibizione alla suddetta mansione:. è stata sottoposta a visita medica preventiva in