Digilent chipKIT Basic I/O Shield Reference Manual

1300 Henley Court
DOC#: 502-216
Copyright Digilent, Inc. All rights reserve d.
Other produc t and company names mentioned may be tra demarks of their res pective owners.
Page 1 of 13
Features include:
Pullman, WA 99163
509.334.6306
www.digilentinc.com
chipKIT™ Basic I/O Shield™ Reference Manual
Revised August 27, 2013 This manual applies to the chipKIT Basic I/O Shie ld rev. C

Overview

The chipKIT Basic I/O Shield is an input/output expansion shield designed for use with chipKIT microcontroller boards such as the Uno32™, uC32™, and the Max32™. These boards are based on the popular Arduino® IDE open­source hardware prototyping platform.
The Basic I/O Shield provides a range of input/output devices for both beginners and advanced users. It 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 also provides more advanced devices such as an I sensor, an organic LED graphic display, and a potentiometer for use as an analog input device.
The Basic I/O Shield has the same form factor as the Uno32 board, but is also useable with the Max32 board.
2
C EEPROM, an I2C temperature
A 128x32 pixel OLED graphic display.
An I
A 256Kbit I
An I
Four push buttons.
Four slide switches.
Eight discrete LEDs.
Four open-drain FET drivers.
An analog potentiometer.
The chipKIT Basic I/O Shield.
2
C temperature sensor.
2
2
C EEPROM.
C daisy chain connector.
chipKIT™ Basic I/O Shield™ Reference Manual
Copyright Digilent, Inc. All rights reserve d. Other produc t and company names mentioned may be tra demarks of their res pective owners.
Page 2 of 13

1 Hardware Overview

The Basic I/O Shield has the following hardware features:
1. Pushbuttons
Four pushbuttons provide discrete momentary-contact digital inputs. These can be accessed using the digitalRead function.
2. Slide Switches
Four slide switches provide discrete digital inputs. These can be accessed using the digitalRead function.
3. J2: Shield Power Connector
This connector receives power from the chipKIT microcontroller board.
4. J3: Analog Signal Connector
Pin 1 (analog signal A0) is connected to a potentiometer. Pins 5 and 6 (labeled A4 and A5) provide
2
access to the I
C signals SDA and SCL for the I2C bus. The I2C bus is used to access the temperature
sensor and the EEPROM and for the I
2
C daisy chain connector.
chipKIT™ Basic I/O Shield™ Reference Manual
Copyright Digilent, Inc. All rights reserve d. Other produc t and company names mentioned may be tra demarks of their res pective owners.
Page 3 of 13
Note: On the Uno32 and uC32 boards, you need to set jumpers JP6 & JP7 to the correct position to access the I
2
C signals onto the board, because the connector that provides the I2C bus on the Max32 board
I doesn’t contact the Basic I/O Shield.
5. Discrete LEDs
The eight LEDs 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 I
2
7. JP2 & JP3: I
C Pull-up Resistor Enable Jumpers
These jumpers are used to enable or disable the I shorting blocks enables the resistors. Removing the shorting blocks disables the resistors.
2
8. J11: I
C Daisy Chain Connector
This is a 2x4 pin header connector that provides access to the I power from the 3.3V power bus and ground. The connector can be used to extend the I another board and to power an external I peripheral modules that can be connected to this shield.
2
C signals on that board. On the Max32 board, you need to use jumper wires to bring the
2
C bus.
2
C pull-up resistors on the I2C bus. Installing the
2
C signals SDA and SCL as well as
2
C device. Digilent has cables and a selection of I2C
2
C bus to
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 & J2: Digital Signal Connectors
These connectors bring digital signals from the chipKIT microcontroller board to the Basic I/O shield.
11. Organic LED Graphic Display
This is a 128x32 pixel monochrome OLED graphic 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.
chipKIT™ Basic I/O Shield™ Reference Manual
Copyright Digilent, Inc. All rights reserve d. Other produc t and company names mentioned may be tra demarks of their res pective owners.
Page 4 of 13

2 Hardware Description

The following is a description of the Basic I/O Shield and how to use it. See Appendix A for pin definitions and Appendix B for sample code to use the OLED graphic display.

2.1 OLED Graphic Displa y

The Basic I/O Shield provides a 128x32 pixel organic LED (OLED) graphic display panel, the WiseChip/Univision UG­23832HSWEG04. The UG2832 uses the Soloman Systech SSD1306 display controller.
Note: 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 toggle the power to the logic of the display. The VBAT_EN control is used to toggle 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:
1. Apply power to VDD.
2. Send Display Off command.
3. Initialize display to desired operating mode.
4. Clear screen.
5. Apply power to VBAT.
6. Delay 100ms.
7. Send Display On command.
Power off sequence:
1. Send Display Off command.
2. Power off VBAT.
3. Delay 100ms.
4. 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 Shield and the Uno32 board, the select pin (SS) is wired low on the Basic I/O Shield and the display is always enabled to receive data over the SPI interface.
chipKIT™ Basic I/O Shield™ Reference Manual
Copyright Digilent, Inc. All rights reserve d. Other produc t and company names mentioned may be tra demarks of their res pective owners.
Page 5 of 13
Digilent has a set of libraries for using the Basic I/O Shield with the chipKIT MPIDE. The OLED library can be used as-is or as a starting point for a more sophisticated graphics library.
It is contained in document # DSD-0000311 (chipKIT IOShield Library.zip) which can be downloaded from the Basic I/O Shield product page at www.digilentinc.com. The OLED library is IOShieldOled.
Appendix B provides sample driver code for initializing the display and writing to it.

2.2 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 Shield 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.
Pushbuttons: There are four pushbuttons 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 pushbuttons) and high when the switch is up (toward the OLED display).
LEDs: There are eight LEDs labeled LD1 –LD8 that are accessed through digital pins 33 – 26. An LED is illuminated when the corresponding pin is set to high using the digitalWrite function and off when set to low.
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.

2.3 Open Drain FET Outp uts

The Basic I/O Shield has 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.
An 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 flows 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 that can damage the FET. The Basic I/O Shield has clamp diodes (also called snubber or flyback diodes) to clamp the voltage spike and feed the current back to the external supply.
The NTHD4508N FETs are rated for a maximum V maximum continuous current of 3.0A at 25ºC and 2.2A at 85ºC. For detailed specifications, see the data sheet available at www.onsemi.com.
(voltage from drain to source) of 20V. They are rated for a
DS
Loading...
+ 9 hidden pages