Digilent MX7cK User Manual
Page 18
![background image](/manuals/673017/18/background.png)
Cerebot MX7cK Reference Manual
www.digilentinc.com
page 18 of 36
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
The Wire library supports a single I
2
C interface,
I2C2 on J8. This is accessed using the Wire
object.
The DTWI library supports four I
2
C interfaces.
The DTWI0 object class is used to create an
object for access to I2C1, connector J7, and
the DTWI1 object class is used to access I2C2,
connector J8. The DTWI2 object class is used
to access I2C3, Pmod connector JE, and the
DTWI3 object class is used to access I2C5,
Pmod connector JF.
The pinouts of the I
2
C connectors are as
follows:
Connector J7
– I2C1
J7-1, J7-2
– SCL1
J7-3, J7-4
– SDA1
J7-5, J7-6
– GND
J7-7, J7-8
– VCC3V3
Connector J8
– I2C2
J8-1, J8-2
– SCL2
J8-3, J8-4
– SDA2
J8-5, J8-6
– GND
J8-7, J8-8
– VCC3V3
Pmod connector JE
– I2C3
JE-02
– SCL3
JE-03
– SDA3
Pmod connector JF
– I2C5
JF-02
– SCL5
JF-03
– SDA5
On-Board I
2
C Peripheral Device
The Cerebot MX7cK provides one on-board
I
2
C peripheral device, a Microchip 24LC256
serial EEPROM. This device is connected to
I2C2. The 24LC256 is a 256Kbit (32Kbyte)
serial EEPROM device to provide non-volatile
memory storage. The device address for the
24LC256 is 1010000 (0x50).
When using the chipKIT MPIDE software, this
device can be accessed using the Wire library
Wire object, or using the DTWI library via the
DTWI1 object class.
Refer to the Microchip data sheet for detailed
information on the operation of this device.
Analog Inputs
The PIC32MX795 microcontroller provides a
10-bit analog to digital (A/D) converter that
provides up to sixteen analog inputs. The
Cerebot MX7cK board provides access to 10
of these inputs via the Pmod connectors. The
converted values produced by the A/D
converter will be in the range 0
–1023.
For detailed information on the operation and
use of the A/D converter, refer to the PIC32
Family Reference Manual, Section 17, 10-bit
AD Converter.
The analog inputs are accessed using the
analogRead() function in the chipKIT MPIDE
software. The analog input pin number is
specified using the symbols A0
–A9. The digital
pin numbers for the pins or the numbers 0
–9
can also be used, but using the symbols A0
–
A9 is recommended.
The following gives the Pmod connector
position, digital pin number, and
microcontroller I/O port and bit number for the
analog inputs:
A0
– JA-01, digital pin 0, RB02
A1
– JA-02, digital pin 1, RB03
A2
– JA-03, digital pin 2, RB04
A3
– JA-04, digital pin 3, RB06
A4
– JA-07, digital pin 4, RB07
A5
– JA-08, digital pin 5, RB08
A6
– JA-09, digital pin 6, RB09
A7
– JA-10, digital pin 7, RB10
A8
– JC-07, digital pin 20, RB15
A9
– JC-10, digital pin 23, RB14
A/D Converter Voltage Reference
The PIC32 microcontroller provides two
voltage reference inputs to the analog to digital
converter. Vref- is used set the lower reference
level and Vref+ is used to set the upper
reference level. These references can be