Digilent MX7cK User Manual
Page 16
![background image](/manuals/673017/16/background.png)
Cerebot MX7cK Reference Manual
www.digilentinc.com
page 16 of 36
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
with the boot loader. This can also be used for
a serial communications interface between the
Cerebot MX7cK board and other software
running on a PC. Resistors are used to
decouple the USB serial interface and so
UART1 can also be used via Pmod connector
JE when not using it to communicate with the
USB serial converter.
Note that when using the MPIDE software,
devices connected to JE can interfere with the
operation of the serial interface and prevent
the MPIDE from successfully downloading
sketches to the board. If this happens,
disconnect the external device from JE until
the sketch has been downloaded and then
reconnect it.
When using the Cerebot MX7cK with the
MPIDE and the chipKIT system, the UARTs
are accessed using the HardwareSerial facility
built into the system. UART1, Pmod connector
JE, is accessed using the Serial object and
UART2, Pmod connector JF, is accessed
using Serial1.
Serial Peripheral Interface (SPI)
SPI is a four wire synchronous serial interface
and SPI devices can operate as either master
devices or as slave device. The PIC32
microcontroller labels the four SPI signals as
Slave Select (SS), Serial Data Out (SDO),
Serial Data In (SDI), and Serial Clock (SCK). A
master device transmits SS, SDO and SCK,
and receives SDI. A slave device receives SS,
SDI, and SCK and transmits SDO. The SS
signal is used to enable the slave device, and
this signal is only significant for slave devices.
A master device can use any general purpose
I/O pin to generate SS to enable the slave.
An SPI transaction begins with the master
device bringing SS low. When the slave sees
SS go low it becomes enabled and waits for
the master to send data. The master shifts
data out on SDO and simultaneously shifts
data in on SDI. The slave device receives data
from the master on its SDI pin and
simultaneously sends data to the master on its
SDO pin. Each time the master sends a byte to
the slave, it simultaneously receives a byte
from the slave.
The PIC32MX795 microcontroller provides four
Serial Peripheral Interfaces. The Cerebot
MX7cK supports use of three ports: SPI1, SPI3
and SPI4. These are accessed using Pmod
connectors JD, JE, and JF.
The following gives the mapping between SPI
signals and connector pins:
SS1
JD-01
SDO1
JD-02
SDI1
JD-03
SCK1
JD-04
SS3
JE-01
SDO3
JE-02
SDI3
JE-03
SCK3
JE-04
SS4
JF-01
SDO4
JF-02
SDI4
JF-03
SCK4
JF-04
Note that early versions of the Microchip
PIC32MX5Xx/6XX/7XX Family Data Sheet
refer to SPI3 as SPI1A and SPI4 as SPI3A.
Detailed information about the operation of the
SPI peripherals can be found in the PIC32
Family Reference Manual, Section 23, Serial
Peripheral Interface.
When using the Cerebot MX7cK with the
MPIDE and the chipKIT system, the SPI ports
are accessed using either the standard chipKIT
SPI library or using the Digilent DSPI library.
The standard SPI library supports access to a
single SPI port, SPI4, Pmod connector JF. This
is accessed using the SPI object.
The DSPI library supports access to all three
SPI ports. The DSPI0 object class is used to
create an object used to access SPI1, Pmod
connector JD. The DSPI1 object class is used
to access SPI3, Pmod connector JE, and the