9analog inputs – Digilent 410-297P-KIT User Manual
Page 14
![background image](/manuals/672896/14/background.png)
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 14 of 25
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 ChipKIT MX3 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 ChipKIT MX3 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 ChipKIT MX3 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.
The Wire library supports a single I
2
C interface, I2C1 on J2. This is accessed using the Wire object.
The DTWI library supports both I
2
C interfaces. The DTWI0 object class is used to create an object for access to I2C1
and the DTWI1 object class is used to access I2C2.
The pinout of the I
2
C daisy chain connector is as follows:
Connector J2. I2C1
• J2-1 – SCL1
• J2-2 – SCL1
• J2-3 – SDA1
• J2-4 – SDA1
• J2-5 – GND
• J2-6 – GND
• J2-7 – BRD_3V3
• J2-8 – BRD_3V3
9
Analog Inputs
The PIC32MX320 microcontroller provides a 10-bit analog to digital (A/D) converter that provides up to sixteen
analog inputs. The ChipKIT MX3 board provides access to 11 inputs on 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 MPIDE software. The analog input pin
number is specified using the symbols A0–A10. The digital pin numbers for the pin or the numbers 0–10 can also
be used, but using the symbols A0–A10 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 – JC-01, digital pin 16, RB8
• A1 – JC-04, digital pin 19, RB14
• A2 – JC-07, digital pin 20, RB0
• A3 – JC-08, digital pin 21, RB1