Digital I/O; External Connections; Digital I/O Port Configuration Using The Spi Interface - VersaLogic EBX-22 Reference Manual

Table of Contents

Advertisement

Digital I/O

The EBX-22 includes a 32-channel digital I/O interface. The digital lines are grouped into two
banks of 16-bit bi-directional ports. The direction of each line is controlled by software. The
digital I/O ports are powered up in the input mode. The 24 mA source/sink drive and short
protected outputs are an excellent choice for industrial LVTTL interfacing. All I/O pins use 3.3V
signaling.
Warning!
Damage may occur if the I/O pins are connected to 5V logic.
Digital I/O can be controlled through the SPI interface or the digital I/O "bit bang" registers.
E
C
XTERNAL
ONNECTIONS
Digital I/O channels are available at connectors J15 and J23 as shown in Table 6 and Table 7,
respectively.
D
I/O P
IGITAL
ORT
Digital I/O channels 0-15 are accessed via SPI slave select 6 (writing 6h to the SS field of
SPICONTROL). Channels 16-31 are accessed via SPI chip select 7 (writing 7h to the SS field).
Each pair of I/O ports is configured by a set of paged I/O registers accessible through SPI. These
registers control settings such as signal direction, input polarity, and interrupt source.
Digital I/O Interrupt Generation Using the SPI Interface
The EBX-22 digital I/O can be configured to issue hardware interrupts on the transition (high to
low or low to high) of any digital I/O pin. IRQ assignment is made in SPI control register
SPISTATUS. Note that this IRQ is shared among all SPI devices on-board and externally
connected to the EBX-22. The IRQ is also shared with the PC/104 bus and must be enabled in
CMOS for ISA IRQx. Digital I/O chip interrupt configuration is achieved through I/O port
register settings. Please refer to the
The on-board digital I/O chips must be configured for open-drain and mirrored interrupts in order
for any SPI device to use hardware interrupts. The following code example illustrates how to do
this. Normally, the BIOS initializes the on-board digital I/O chips at boot time.
MOV
DX, 1D8h
MOV
AL, 26h
OUT
DX, AL
MOV
DX, 1D9h
MOV
AL, 30h
OUT
DX, AL
MOV
DX, 1DBh
MOV
AL, 44h
OUT
DX, AL
MOV
DX, 1DCh
MOV
AL, 0Ah
OUT
DX, AL
MOV
DX, 1DDh
MOV
AL, 40h
OUT
DX, AL
BUSY: MOV
DX, 1D9h
IN
AL, DX
EBX-22 Reference Manual
C
U
ONFIGURATION
SING THE
Microchip MCP23S17 datasheet
;SPICONTROL: SPI Mode 00, 24bit, auto DIO_0_SS#
;SPISTATUS: 8MHz, no IRQ, left-shift
;SPIDATA1: Mirror & Open-Drain interrupts
;SPIDATA2: MCP23S17 address 0x0A
;SPIDATA3: MCP23S17 write command
;Get SPI status
Interfaces and Connectors
SPI I
NTERFACE
for more information.
56

Advertisement

Table of Contents
loading

Table of Contents