Digilent 410-216P-KIT User Manual
Page 5
chipKIT Basic I/O Shield Reference Manual
www.digilentinc.com
page 5 of 15
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Discrete Digital I/O Devices
The Basic I/O Shield provides various discrete
digital I/O devices. These can be accessed
using the
digitalRead
and
digitalWrite
functions. The
pinMode
function is used to set
the pin to input or output.
When the buttons and switches on the Basic
I/O are not being used, the pins are available
on the pass-through shield connectors for use
by other shields in the stack. The pins used by
the LEDs are also available, however the
presence of the LEDs on the lines will load
them down, possibly causing some devices to
not work. It is safe to use any of these pins as
either inputs or outputs.
Push Buttons: There are four push buttons
switches labeled BTN1 (pin 4), BTN2 (pin 34),
BTN3 (pin 36), and BTN4 (pin 37). The
digitalRead
function will return
LOW
if the
button is not pressed and
HIGH
when the
button is pressed.
Slide Switches: There are four slide switches
labeled SW1 (pin 2), SW2 (pin 7), SW3 (pin 8)
and SW4 (pin 35). The
digitalRead
function will
return
LOW
when the switch is down (toward
the push buttons) and
HIGH
when the switch is
up (toward the OLED display).
LEDs: There are eight LEDs, labeled LD1 –
LD8 accessed as digital pins 33 – 26. An LED
will be illuminated when the corresponding pin
is set to the
HIGH
state using the
digitalWrite
function and off when set to the
LOW
state.
The LEDs are attached to the low eight bits of
PORTE, with LD1 connected to PORTE bit 0,
and LD8 connected to PORTE bit 7. An 8-bit
value written to PORTE (or LATE) will display
the corresponding binary value on the LEDs.
Open Drain FET Outputs
The Basic I/O provides four open drain FET
outputs. These are low-side N-channel devices
and can be used to provide a digital switch
closure to ground. These can be used to
switch external loads, such as relay coils,
solenoids, stepper motors, and so on.
The FETs used are the NTHD4508N. These
FETs are rated for a maximum V
DS
(voltage
from drain to source) of 20V. They are rated for
a maximum continuous current of 3.0A at 25ºC
and 2.2A at 85ºC. For more detailed
specifications for the FETs refer to the data
sheet available from the On Semiconductor
web site.
The FETs are labeled Q1A (pin 9), Q1B (pin
6), Q2A (pin 5), and Q2B (pin 3). These four
pins are also four of the PWM outputs
supported by the chipKIT boards and the FETs
can be switched using pulse width modulation
(PWM) using the
analogWrite
function.
An FET is switched on by driving its gate high.
When the FET is on, it provides a low
impedance path to ground (similar to a closed
switch to ground). When the FET is switched
off by driving its gate low, it becomes a high
impedance path to ground (similar to an open
switch to ground). Pull-down resistors are
connected to the gate of each FET to ensure
that it is off unless being actively driven high by
the microcontroller on the chipKIT board.
The FET outputs are accessed via the screw
terminal connectors J7 and J8 on the left side
of the board. The digital signals used to switch
the FETs on and off are also available on
screw terminal connectors J9 and J10 at the
left side of the upper edge of the board.
A FET is used to switch an external load, such
as a relay coil, on and off. The load is wired
between the positive side of an external power
supply and the output of the FET. When the
FET is switched on, current will flow from the
external power supply through the load and the
FET to ground.
FETs are often used to switch highly inductive
loads, such as relay coils, solenoids, and
motors. When the current through an inductive
load is switched off, a voltage spike will occur