Spi Interface - Digilent Cerebot MC7 Reference Manual

Hide thumbs Also See for Cerebot MC7:
Table of Contents

Advertisement

Cerebot MC7™ Board Reference Manual
See the "Connector and Jumper Block Pinout Tables" section below for more information about connecting
peripheral modules and other devices to the Cerebot MC7. These tables indicate the mapping between pins on
the dsPIC microcontroller and the pins on the various connectors.

12 SPI Interface

SPI is a four-wire synchronous serial communications interface used by many microcontrollers and peripheral
devices.
The SPI interface is made up of the following four signals generally called: SS (slave select), MOSI (master out/slave
in), MISO (master in/slave out), and SCK (serial clock). On the dsPIC microcontroller, the SPI signals are called SS
(slave select), SDO (serial data out), SDI (serial data in), and SCK (serial clock).
When an SPI master device communicates with a slave device, it initiates the communication by bring the SS line
low. This enables the slave device to receive the data. The master device then sends one or more bytes to the
slave. The data is shifted serially out the MOSI pin to the slave. The slave device simultaneously shifts out a byte to
the master on MISO. Each time a byte is sent from the master to the slave, a byte is sent from the slave to the
master. The master generates the serial clock on the SCK line, and the slave uses that as the clock to shift the data
in and out. When the master has finished sending data to the slave, it ends the transaction by bringing the SS line
high.
The dsPIC microcontroller used on the Cerebot MC7 provides two SPI controllers. One of these controllers (SPI2) is
available for use on Pmod connector JB. This SPI controller can be used as either an SPI master or an SPI slave. The
other SPI controller (SPI1) is available on Pmod connector JA. The SS signal for SPI1 is not available at connector JA,
and therefore SPI1 can only be used as an SPI master. When using SPI1, PORTD bit 9 (RD9) is used to drive the SS
signal of the connected SPI slave.
Jumpers JP2 and JP3 are used to select whether SPI2 on connector JB is operating as an SPI master of as an SPI
slave. For operation as an SPI master, JP2 (SDI2) is placed in the MISO position (to the left), and JP3 (SDO2) is
placed in the MOSI position (to the right). For operation as an SPI slave, JP2 is placed in the MOSI position and JP3
is placed in the MISO position.
Refer to the data sheet for the dsPIC microcontroller and the dsPIC33F Family Reference Manual for detailed
information on configuring and using the SPI interfaces.
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
JP3
JP3
JP2
JP2
SPI Master
SPI Slave
Jumper settings for SPI.
Page 10 of 22

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Cerebot MC7 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents