Digilent 410-216P User Manual

cchhiippKKIITT™™ BBaassiicc II//OO SShhiieelldd
BBooaarrdd RReeffeerreennccee MMaannuuaal
l
Revision: July 16, 2011
Overview
The chipKIT Basic I/O Shield is a input/output expansion board designed for use with chipKIT microcontroller boards such as the Uno32™ and the Max32™.
The Basic I/O Shield is designed to provide a range of input/output devices suitable for beginners learning about microcontrollers and various types of I/O devices, or for use by more advanced user to provide inputs or outputs for their own projects.
The Basic I/O Shield provides simple digital input devices such as switches and buttons, and digital output devices such as discrete LEDs and high current open FET drivers. It provides more advanced devices such as an I2C EEPROM, an I2C temperature sensor, and organic LED graphic display. A potentiometer is also provided for use as an analog input device.
The Basic I/O Shield is designed to the same form factor as the Uno32 board, but is also useable with the Max32 board.
Features:
128x32 pixel OLED graphic display I2C temperature sensor 256Kbit I2C EEPROM I2C daisy chain connector 4 push buttons 4 slide switches 8 discrete LEDs 4 open drain FET drivers Analog potentiometer
1300 NE Henley Court, Suite 3
Pullman, WA 99163
(509) 334 6306 Voice | (509) 334 6300 Fax
Doc: 502-216 page 1 of 15
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
chipKIT Basic I/O Shield Reference Manual
chipKIT Basic I/O Shield Hardware Overview
The Basic I/O Shield has the following hardware features:
1) Push Buttons
Four push buttons provide momentary contact discrete digital inputs. These can be accessed using the
digitalRead
function.
2) Slide switches
Four slide switches that provide discrete digital inputs. These can be accessed using the
digitalRead
function.
3) J2 – Shield Power Connector
This connector powers the board, receiving power from the chipKIT microcontroller board.
www.digilentinc.com page 2 of 15
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
chipKIT Basic I/O Shield Reference Manual
4) J3 – Analog Signal Connector
Pin 1 (analog signal A0) is connected to a potentiometer. Pins 5 and 6 (labeled as A4 and A5) provide access to the I2C signals SDA and SCL for the I2C bus. The I2C bus is used to access the temperature sensor and the EEPROM and for the I2C daisy chain connector.
Note: On the Uno32 it is necessary to set jumpers JP6 & JP7 to the correct position for accessing the I2C signals on that board. On the Max32 board, it is necessary to use jumper wires to bring the I2C signals onto the board, as the connector providing the I2C bus on the Max32 board doesn’t contact the Basic I/O Shield.
5) Discrete LEDs
Eight LEDs that provide discrete digital outputs. These can be accessed individually using the
digitalWrite
function. The LEDs are connected to the low eight bits of microcontroller
PORTE and all eight can be written at the same time by writing to PORTE.
6) IC2 – Temperature Sensor
This is a Microchip TCN75A digital temperature sensor. It is accessed via the I2C bus.
7) JP2/JP3 – I2C Pull-up Resistor Enable Jumpers
These jumpers are used to enable or disable the presence of the I2C pull-up resistors on the I2C bus. Having the shorting blocks installed enables the resistors. Removing the shorting blocks disables them.
8) J11 – I2C Daisy Chain Connector
This is a 2x4 pin header connector that provides access to the I2C signals SDA and SCL as well as power from the 3.3V power bus and ground. This can be used to extend the I2C bus off of the board and to power external I2C device. Digilent has cables and a selection of I2C peripheral modules that can be accessed using this connector.
9) Potentiometer
This is a 10K ohm potentiometer connected across VCC3V3 and ground. It provides an analog input voltage to analog input A0.
10) J1 and J2 – Digital Signal Connectors
These connectors bring digital signals from the chipKIT microcontroller board onto the Basic I/O Shield board.
11) Organic LED Graphic Display
This is a 128x32 pixel monochrome OLED graphic display panel. This display panel is accessed using the SPI interface.
12) J9 & J10 – Digital I/O Signal Connectors
These are screw terminal connectors that provide access to digital I/O signals 3, 5, 6, and
9. These are four of the PWM signals from the chipKIT microcontroller board.
13) J6 – Open Drain FET Power Connector
This provides access to the power connections for the open drain FETs.
14) , J7, & J8 – Open Drain FET Output
These provide access to the outputs of the open drain FETs.
www.digilentinc.com page 3 of 15
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
chipKIT Basic I/O Shield Reference Manual
chipKIT Basic I/O Shield Hardware Description
Introduction
The following gives a basic description of the input/output hardware contained in the Basic I/O Shield and how to use it. Refer to Appendix A for a table showing pin definitions, and Appendix B for example code to use the OLED graphic display.
OLED Graphic Display
The Basic I/O board provides a 128x32 pixel, Organic LED (OLED), graphic display panel. The graphic display panel used is the WiseChip/Univision UG-23832HSWEG04. This display uses the Soloman Systech SSD1306 display controller.
The UG2832 has a power on/power off sequence that should be followed. Failure to follow the power on/power off sequence can shorten the life of the display. The Basic I/O provides two FETs for software control of the two power supplies for the display. The VDD_EN control is used to turn on/off the power to the logic of the display. The VBAT_EN control is used to turn on/off power to the OLED display itself. These two pins have pull-up resistors to turn off their respective power supplies when not being driven. The pin is made an output and driven low to turn on the power supply.
Power on sequence:
Apply power to VDD Send Display Off command Initialize display to desired operating mode Clear screen Apply power to VBAT Delay 100ms Send Display On command
Power off sequence:
Send Display Off command Power off VBAT Delay 100ms Power off VDD
The display has a D/C pin (display or command select) that is used to determine whether bytes sent to the display are interpreted as commands or as display data. The D/C pin is set HIGH for display buffer access and LOW for command access.
The RES pin is used to reset the SG1306 display controller. The RES pin is driven LOW for reset and driven HIGH for normal operation. The low going reset pulse must be a minimum of 3us (microseconds) for the display controller to reset correctly.
The UG2832 is a serial device that is accessed using SPI. It is however, a write-only device. It is not possible to read back either the display buffer contents or any kind of status from the panel. The maximum SPI clock frequency supported by the UG2832 is 10Mhz. Due to pin limitations between the Basic I/O and the Uno32 board, the select pin (SS) is wired low on the Basic I/O board and the display is always enabled to receive data over the SPI interface.
Digilent has a library for use with the Basic I/O that provides functions for initializing the display and rendering simple text and graphics onto the display. This library can be used as-is or as a starting point for a more sophisticated graphics library. This library is available on the Digilent web site and in the third part libraries repository on github.
Appendix B provides example code that shows initializing the display and writing to it.
www.digilentinc.com page 4 of 15
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
chipKIT Basic I/O Shield Reference Manual
Discrete Digital I/O Devices
The Basic I/O Shield provides various discrete digital I/O devices. These can be accessed
using the functions. The
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
button is not pressed and 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 return the push buttons) and
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 function and off when set to the
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.
digitalRead
function will return
and
pinMode
digitalWrite
function is used to set
LOW
HIGH
when the
digitalRead
LOW
when the switch is down (toward
HIGH
when the switch is
HIGH
state using the
digitalWrite
LOW
if the
function will
state.
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 VDS (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
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
analogWrite
function.
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.
Loading...
+ 10 hidden pages