Interfaces and Connectors
EBX-11 Reference manual
44
Industrial I/O Functions and SPI Interface
The EBX-11 employs a set of I/O registers for controlling on-board analog input, digital I/O, and
external serial peripheral interface (SPI) devices. These functions share control and data registers
located at I/O addresses 1D8h through 1DDh.
The SPI bus specifies four logic signals:
SCLK – Serial clock (output from master)
MOSI – Master output, slave input (output from master)
MISO – Master input, slave output (output from slave)
SS – Slave select (output from master)
The EBX-11 SPI implementation adds additional features, such as hardware interrupt input to the
master. The master initiates all SPI transactions. A slave device responds when its slave select is
asserted and it receives clock pulses from the master.
Slave selects are controlled in one of two modes: manual or automatic. In automatic mode, the
slave select is asserted by the SPI controller when the most significant data byte is written. This
initiates a transaction to the specified slave device. In manual mode, the slave select is controlled
by the user and any number of data frames can be sent. The user must command the slave select
high to complete the transaction.
The SPI clock rate can be software configured to operate at speeds between 1 MHz and 8 MHz.
All four common SPI modes are supported through the use of clock polarity and clock phase
controls.
To initiate an SPI transaction, configure SPI registers SPICONTROL and SPISTATUS as shown
in Table 23 and Table 24 for the desired I/O device. For additional information on
communicating with specific SPI devices, please refer to their respective manufacturer’s
datasheets. Table 22 lists configuration values for on-board SPI devices.
Table 22: Analog Input and Digital I/O Register Values
Analog Input
Digital I/O
I/O Port
Value
Description
I/O Port
Value
Description
1D8h
15h
Idle low, rising edge, 16-bit
frame length, automatic slave
select, ADC_SS
1D8h
26h
Idle low, rising edge, 24-bit
frame length, auto slave select,
DIO_0_SS
1D9h
30h
8 MHz, IRQ disabled, MSbit
shift
1D9h
F8h
IRQ10, 8 MHz, hardware IRQ
enabled, MSbit shift
1DAh
00h
Not used in 16-bit frame
1DAh
00h
Not used in 24-bit frame
1DBh
00h
Not used in 16-bit frame
1DBh
XXh
Data byte
1DCh
00h
Any value, data ignored
1DCh
XXh
Address byte
1DDh
XXh
XX = A/D channel (0-7),
written to bits 5-3
1DDh
XXh
Command byte
StockCheck.com