Demand Peripherals     Robotics and Automation Made Easy

ESPI: Generic SPI Interface

The ESPI peripheral and card provide a general purpose SPI interface for your robot or other automation. Reads and writes to the SPI bus are organized as packets that can have up to 14 bytes.

 

Hardware:

The ESPI, "encoded clock SPI", peripheral supports SPI Modes 0 2. It does not support SPI modes 1 or 3. Data is sent as a packet with up to 14 bytes. Four different SCK clock frequencies are supported. You can configure the chip select line to be forced high, force low, active high during transfers or active low during transfers. More information about the ESPI card is available here: /cards/espi.html

 

Resources:

Resources for the ESPI peripheral let you set the clock frequency and the polarity of the chip select.

config : the clock rate and chip select mode as as two strings separated by space and terminated by a new line.

The sck clock frequency can be one of four values. Invalid values are rounded to the nearest valid value. Available clock frequencies are:

   2000000 -- 2 MHz
   1000000 -- 1 MHz
    500000 -- 500 KHz
    100000 -- 100 KHz

The behavior of the chip select line is specified as a two character strint. The following are the possible choices:

  'al'  -- active low: low during transfers, high otherwise
  'ah'  -- active high: high during transfers, low otherwise
  'fl'  -- forced low
  'fh'  -- forced high

A sample configuration line for a SPI port using SPI Mode 0 at 1 MHz, and with an active low chip select could be entered as follows:
    dpset espi config 1000000 al

data : the data to send to the SPI device as up to 14 hex values separated by spaces and terminated by a newline.

The dpget command provides both read and write functionality for the ESPI peripheral. Additional bytes on the dpget command line are sent to the SPI device and each byte sent gives another hex value in the response.

For example:

    dpget espi data 03 12 34 00

Might return:
    00 67 89 ab

FPGA Defined Peripherals
User Interface
FPGA Configuration
FPGA Buttons & LEDs
Text LCD and Keypad
Quad WS2812 Interface
Quad Slide Pot
Tone Generator
IR Recv/Xmit
6 Digit LCD
RC Decoder
Keyfob RF Decoder
Rotary Encoder Interface
Quad Touch Interface
Motion Control
Dual DC Motor Controller
Dual Quadrature Decoder
Quad 13 Bit Servo
Bipolar Stepper Controller
Unipolar Stepper Controller
Simple Input / Output
Quad Binary Output
Quad Binary Input
Quad GPIO
Octal Input/Output
32 Channel Binary Output
32 Channel Binary Input
Sensors
Octal 12-bit ADC
Quad Ping))) Interface
Octal SRF04 Interface
Quad Event Counter
Instrumentation
Generic I2C
Generic SPI
Octal 8-Bit DAC
Quad Digital Potentiometer
Quad PWM Output
Quad PWM Input
4 Bit Pattern Generator
Real Time Clock
Dual Watchdog Timers
  

Interface Cards
User Interface
Audio Amplifier
IR Recv/xmit
Six Digit LCD Display
Keyfob RF Receiver
Rotary Encoder
Quad Switch Card
Text LCD / keypad
Quad Slide Pot
Quad Touch Interface
Motion Control
Dual 7-amp H-bridge
Quad Open Drain Driver
Quad 10 Amp Relay Card
Input / Output
Octal 8-Bit DAC
Quad Digital Potentiometer
Octal 12-bit ADC
9DOF IMU
Octal SRF04
Quad GPIO
Generic I2C
Generic SPI
USB 2.0 Hub
Real Time Clock
Slot Expander
Octal Input/Output
32 Channel Input
32 Channel Output
Accessories
Power Distribution Card
15 Amp Power Distribution
5 Volt Switching Regulator
ATX Power Break-Out Card
Disk Drive Power Break-Out
MP43 Aluminum Mounting Plate
WW2 Prototyping Card
WW1 Small Prototyping Card