beautypg.com

Digilent MX3cK User Manual

Page 8

background image

Cerebot MX3cK Reference Manual

www.digilentinc.com

page 8 of 23

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

connectors. These pin numbers start with pin 0
and are numbered up consecutively.

On the Cerebot MX3cK, pin numbers 0–39 are
used to access the pins on the Pmod
connectors and pin numbers 40 and 41 are
used for the two signal pins on the I

2

C

connector. The pin numbers are assigned so
that connector JA pin 1 (JA-01) is digital pin 0,
JA pin 2 (JA-02) is digital pin 1, and so on.

Pins 0-7 are on connector JA, pins 8-15 on JB,
pins 16-23 on JC, pins 24-31 on JD, and pins
32-39 on JE. Refer to the tables in Appendices
B–D for detailed information about the pin
mapping between Pmod connector, logical pin
number, and PIC32 microcontroller pin number
and pin function.

When using the Cerebot MX3cK with the
chipKIT MPIDE the functions pinMode(),
digitalRead(), and digitalWrite() are used for
digital pin I/O.

The pinMode() function is used to set the pin
direction. Pin direction can be set to: INPUT,
OUTPUT, or OPEN. OPEN is used for open-
drain and implies output.

The digitalRead() and digitalWrite() functions
are used to read or write the pins.
DigitalRead() returns the current state of the
specified pin, and digitalWrite is used to set the
state of an output pin. The pin state can be
either HIGH or LOW.

User LEDs


Two LEDs are provided, LD4 and LD5,
connected to I/O port F bits 0 and 1 (RF00 and
RF01). LATF Bit 0 is connected to LD4 and bit
1 is connected to LD5. The LEDs are turned on
or off by configuring these two pins as outputs
and driving them high or low. Driving the pin
high turns the LED on, driving it low turns it off.
These I/O pins are dedicated to use with the
LEDs and are not available at any connector.

When using the MPIDE and the chipKIT
system, the LEDs are accessed as digital pins

42 (LD4) and 43 (LD5), or preferably, using the
symbols PIN_LED1 and PIN_LED2.

5V Signal Compatibility


The PIC32 microcontroller operates at 3.3V.
And the I/O pins provide 3.3V logic levels. It is
possible, in some circumstances, to use the
Cerebot MX3cK to operate with 5V logic
devices.

There are two issues to consider when dealing
with 5V compatibility for 3.3V logic. The first is
protection of 3.3V inputs from damage caused
by 5V signals. The second is whether the 3.3V
output is high enough to be recognized as a
logic high value by a 5V input.

The digital I/O pins on the PIC32
microcontroller are 5V tolerant. It is safe to
apply 5V logic signals directly to these pins
without risk of damage to the microcontroller.

The analog capable I/O pins on the PIC32 are
not 5V tolerant. The absolute maximum
voltage rating for the analog pins is 3.6V.
Generally, the analog pins are the pins on I/O
port B, however, there are other non-5V
tolerant pins on the device.

Refer to the PIC32MX3XX/4XX Family Data
Sheet for more information about which pins
on the device are 5V tolerant before applying
input signals higher than 3.3V to any pin on the
Cerebot MX3cK board.

If a 5V signal is to applied to a non-5V tolerant
pin, some external means must be used to limit
the applied voltage to 3.6V or less. The
Cerebot MX3cK board provides 200 ohm
series resistors between the microcontroller
pins and the Pmod connector pins. These
resistors are primarily intended to provide short
circuit protection on the outputs, but will also
provide limited protection if a 5V signal is
inadvertently applied to a non-5V tolerant pin.

One technique that can be used to limit and
input voltage to a safe level is to use a 200
ohm series resistor and Shotkey diode