Accell MPC-68K Series Uživatelský manuál Strana 21

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 45
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 44 45

Komentáře k této Příručce

Žádné komentáře