Accell MPC-68K Series Manuale Utente Pagina 21

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 45
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 20
I/O control
You can control an I/O Port for every bit or byte.
Bit operating is for simple device control. ex. solenoid valves, relays and switches etc.
Byte operating is used for reading DSW, data exchange with external devices etc.
Bit control
ON 0 /* output #0 turn on
OFF 1 /* output #1 turn off
WAIT SW(192)==1 /* wait for input #192 to turn on
IF SW(1)==1 THEN : GOTO *LABEL : END_IF /* conditional branch
ON -1 /* negative number = memory I/O.
WAIT SW(-2)==0 /*
Byte control
OUT 170 0 /* 170(decimal) is outputted to bank #0.
A=IN(0) /* the value of bank#0 loads to variable A.
OUT A B /* the value of A loads to out-port B.
WAIT IN(1)==255 /* wait to reach 255.
IF IN(2)==&H0F THEN : GOTO *LABEL : END_IF /* conditional branch
OUT &HFF -1 /* negative number is memory I/O.
WAIT IN(-1)==&HAA /*
21
Vedere la pagina 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 44 45

Commenti su questo manuale

Nessun commento