Agilent Technologies E1330B Manual de usuario Pagina 127

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 156
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 126
Agilent E1330B Digital I/O Module Register Information 125
Appendix B
Writing an
8-Bit Byte
Using the output algorithm described earlier, the following programs describe how
to output an 8-bit byte to your peripheral device. The program use a leading edge
handshake and flag-driven data transfer to send data (decimal value 255) from
Port 1.
IBASIC Version 10 Base_addr = DVAL("1FE400",16)
20 !Logical Address 144.
30 WRITEIO 9826,Base_Addr+DVAL("19",16);32
40 !Sets Port 1 Handshake Register to leading edge handshake and flag
50 !driven transfer.
60 WRITEIO 9826,Base_Addr+DVAL("1D",16);00
70 !Sets Port 1 Delay Register to 0.
80 WRITEIO 9826,Base_Addr+DVAL("21",16);00
90 !Sets Port 1 Normalization Register (polarity) to positive-true (High = true).
100 WRITEIO 9826,Base_Addr+DVAL("11",16);0
110 !Sets Port 1 Status Control bit 6 to enable output.
120 WRITEIO 9826,Base_Addr+DVAL("0D",16);2
130 !Sets Port 1 Transfer Control Register bit 1 to Enable Handshake.
140 WRITEIO 9826,Base_Addr+DVAL("15",16);255
150 !Sets Port 1 Data Register to the value to output.
160 REPEAT
170 UNTIL BIT(READIO ( 9826,Base_addr+DVAL("0D",16)),1)
180 !If more data to send, repeat lines 140 - 170.
190 WRITEIO 9826,Base_Addr+DVAL("0D",16);0
200 !Clears Port 1 Transfer Control Register bit 1 to Disable Handshake.
210 END
Vista de pagina 126
1 2 ... 122 123 124 125 126 127 128 129 130 131 132 ... 155 156

Comentarios a estos manuales

Sin comentarios