C™ interface – Digilent 410-297P-KIT User Manual
Page 13

ChipKIT MX3 Board Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 13 of 25
• SDO1
JB-02
• SDI1
JB-03
• SCK1
JB-04
• SS2 JE-01
• MOSI
JE-02
• MISO
JE-03
• SCK2
JE-04
SPI1 is only laid out to support use as an SPI master. To use SPI1 as a slave device, it is necessary to use external
wiring to connect the signals appropriately. When using SPI1 as a slave device, the SS1 signal is obtained from
Pmod connector JD, pin 1 (JD-01).
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 ChipKIT MX3 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.
8
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 ChipKIT MX3 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 ChipKIT MX3 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 ChipKIT MX3, I2C1 provides selectable pull-up resistors that can be enabled or