Appendix C
Register-Level Programming
PC-DIO-24/PnP User Manual
C-16
©
National Instruments Corporation
Figure C-3.
Port C Pin Assignments, Mode 1 Output
Mode 1 Output Programming Example
The following example shows how to configure PPI A for various
combinations of mode 1 output. This code is strictly an example and is
not intended to be used without modification in a practical situation.
Main() {
#define BASE_ADDRESS
0x180
/* Board located at address 180 */
#define PORTAoffset
0x00
/* Offset for port A */
#define PORTBoffset
0x01
/* Offset for port B */
#define PORTCoffset
0x02
/* Offset for port C */
#define CNFGoffset
0x03
/* Offset for CNFG */
unsigned int porta, portb, portc, cnfg;
char valread;
/* Variable to store data read from a port */
/* Calculate register addresses */
porta = BASE_A PORTAoffset;
portb = BASE_A PORTBoffset;
portc = BASE_A PORTCoffset;
cnfg = BASE_A CNFGoffset;
/* EXAMPLE 1–port A output */
outp(cnfg,0xA0);
/* Port A is an output in mode 1.*/
while (!(inp(portc) & 0x80));
/* Wait until OBFA* is set,
indicating that the data last
written to port A has been
read.*/
outp(porta,0x12);
/* Write data to port A. */
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
OBFA*
ACKA*
I/O
I/O
INTRA
ACKB*
OBFB*
INTRB
Group A
Group B
Содержание PC-DIO-24/PnP
Страница 45: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 2 National Instruments Corporation ...
Страница 46: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 3 PC DIO 24 PnP User Manual ...
Страница 47: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 4 National Instruments Corporation ...
Страница 48: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 5 PC DIO 24 PnP User Manual ...
Страница 49: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 6 National Instruments Corporation ...
Страница 50: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 7 PC DIO 24 PnP User Manual ...
Страница 51: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 8 National Instruments Corporation ...
Страница 52: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 9 PC DIO 24 PnP User Manual ...
Страница 53: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 10 National Instruments Corporation ...
Страница 54: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 11 PC DIO 24 PnP User Manual ...
Страница 55: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 12 National Instruments Corporation ...
Страница 56: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 13 PC DIO 24 PnP User Manual ...
Страница 57: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 14 National Instruments Corporation ...
Страница 58: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 15 PC DIO 24 PnP User Manual ...
Страница 59: ...Appendix B OKI 82C55A Data Sheet PC DIO 24 PnP User Manual B 16 National Instruments Corporation ...
Страница 60: ...Appendix B OKI 82C55A Data Sheet National Instruments Corporation B 17 PC DIO 24 PnP User Manual ...