beautypg.com

Digilent MX3cK User Manual

Page 12

background image

Cerebot MX3cK Reference Manual

www.digilentinc.com

page 12 of 23

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.


SPI2 is laid out on the board for use either as
an SPI master or as an SPI slave device.
Jumpers JP6 & JP8 are used to select
between master and slave. These jumpers
switch the microcontroller signals SDO2 and
SDI2 between the SPI signals MOSI and MISO
at the Pmod connector. Place the shorting
blocks on these jumpers in the M position
when operating as an SPI master and in the S
position when operating as an SPI slave
device.

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 MX3cK 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, SPI2. This is accessed using
the SPI object.

The DSPI library supports access to both SPI
ports. The DSPI0 object class is used to create
an object used to access the default SPI port,
SPI2, and the DSPI1 object class is used to
access SPI1.

I

2

C™ Interface


The Inter-Integrated Circuit (I

2

C

TM

) Interface

provides a medium speed (100K or 400K bps)
synchronous serial communications bus. The
I

2

C interface provides master and slave

operation using either 7 bit or 10 bit device
addressing. Each device is given a unique
address, and the protocol provides the ability
to address packets to a specific device or to
broadcast packets to all devices on the bus.
Refer to the Microchip PIC32MX3XX/4XX
Family Data Sheet and the PIC32 Family
Reference Manual for detailed information on
configuring and using the I

2

C interface.

The PIC32MX320 microcontroller provides for
two independent I

2

C interfaces. The Cerebot

MX3cK is designed to provide dedicated
access to one of these interfaces, I2C1, using
I

2

C daisy chain connector J2. The other I

2

C

interface, I2C2, can be accessed at pins 2 & 3
on Pmod connector JC.

The I

2

C daisy chain connector provides two

positions for connecting to the I

2

C signals,

power and ground. By using two-wire or four-
wire MTE cables (available separately from
Digilent) a daisy chain of multiple Cerebot
MX3cK boards or other I

2

C-capable boards

can be created.

The I

2

C bus is an open-collector bus. Devices

on the bus actively drive the signals low. The
high state of the I

2

C signals is achieved by pull-

up resistors when no device is driving the lines
low. One device on the I

2

C bus must provide

the pull-up resistors. On the Cerebot MX3cK,
I2C1 provides selectable pull-up resistors that
can be enabled or disabled via jumper blocks
JP1 and JP10, near Pmod connector JA. The
pull-ups are enabled by installing shorting
blocks and are disabled by removing the
shorting blocks. Generally, only one device on
the bus will have the pull-ups enabled.

There are no pull-up resistors provided on the
Cerebot MX3cK for I2C2. If I2C2 is to be used,
external pull-up resistors must be provided.
The operating voltage for the I

2

C busses on the

Cerebot MX3cK is 3.3V. External pull-up
resistors must be connected to a 3.3V source.

Detailed information about the operation of the
I

2

C peripherals can be found in the PIC32

Family Reference Manual, Section 24, Inter-
Integrated Circuit.

When using the Cerebot MX3cK with the
MPIDE and the chipKIT system, the I

2

C

interfaces are accessed using the standard
chipKIT Wire library, or the Digilent DTWI
library.