chipKIT™ MX3 Board Reference Manual
The analog reference input pins are shared with two of the analog inputs. Vref- is shared with A3 (AN1/RB1), and
Vref+ is shared with A2 (AN0/RB0). These pins are not available to be used as analog inputs when being used as an
external reference.
When using the MPIDE software, the use of external analog references is selected using the analogReference()
function. The following values can be used with analogReference():
DEFAULT – Vref- = 0V, Vref+ = 3.3V
INTERNAL – same as default
EXTERNAL – Vref- = 0V, Vref+ = voltage at A2
EXTMINUS – Vref- = voltage at A3, Vref+ = 3.3V
EXTPLUSMINUS – Vref- = voltage at A3, Vref+ = voltage at A2
11 Timers
The PIC32 microcontroller provides five timers that can be used for various timing functions. These timers are each
16 bits wide, although two pairs, TIMER2/TIMER3 and TIMER4/TIMER5, can be combined to produce 32 bit wide
timers.
A timer consists of a control register, a counter register, and a period register. The control register is used to
configure the timer for various modes of operation. The count register counts cycles of the clock source selected
via the control register. This clock source can be the peripheral bus clock or a division of the peripheral bus clock
via a prescaler divider. The period register can be used to generate an interrupt and/or reset the count register
when a predetermined value is reached.
For detailed information on the operation of the PIC32 timers, refer to the PIC32 Family Reference Manual, Section
14, Timers.
Control and operation of the timers is not explicitly provided in the current version of the MPIDE software. This
capability will be added in a future version of the software. Timers are used implicitly by various core functions and
libraries, however.
12 Output Compare
The PIC32 microcontroller provides five output compare units that can be used to control the timing of state
changes on certain output pins or to generate pulse width modulated (PWM) outputs.
Each output compare unit works with a particular output pin (OC1-OC5). It can be programmed to control the pin
in any of the following ways:
PWM output
Generate continuous pulses
Generate a single pulse
Toggle the output pin
Generate falling edge
Generate rising edge
The output compare units work in conjunction with a timer. Either Timer2 or Timer3 can be used with any of the
five output compare units.
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 14 of 24
Need help?
Do you have a question about the chipKIT MX3 and is the answer not in the manual?
Questions and answers