background image

Now that we are more familiar with the hardware present on the Qwiic GPIO it's time to hook it up to our
microcontroller and attach some peripherals to the I/O pins. Next up we'll detail how to assemble the board and
your Qwiic GPIO circuit.

Hardware Assembly

The Qwiic system makes connecting the Qwiic GPIO to your chosen microcontroller a breeze. All you need to do
is connect your Qwiic GPIO to your chosen development board with a Qwiic cable or adapter cable. If you would
prefer to not use the Qwiic connectors, you can connect to the 0.1" header pins broken out on the side of the
board.

If you prefer to use the PTH pins broken out on the Qwiic GPIO you will need to solder to them. For a temporary
connection for prototyping, these IC Hooks are a great option to make that connection. For users not familiar with
through-hole soldering take a look at this tutorial:

Connecting peripherals to the GPIO is simple as well with the latch terminals. If you are using hook-up wire, make
sure you've stripped the end, insert it into the appropriate terminal (making sure it is "open") and then press down
on the latch terminal firmly to secure the wire in place. Depending on how you intend to use the I/O pin you'll want
to connect your other wire to either a 

3.3V

 or 

Ground

 pin. For demonstration purposes, we're using LEDs and

buttons to act as our inputs and outputs (respectively).

How to Solder: Through-Hole Soldering

SEPTEMBER 19, 2013
This tutorial covers everything you need to know about through-hole soldering.

Summary of Contents for Qwiic GPIO

Page 1: ...ander IC from Texas Instruments to add up to 8 digital inputs and outputs controlled via an I C interface The TCA9534U features three address select pins that can be set to configure eight unique addr...

Page 2: ...e In this guide we ll go over everything you need to know about the Qwiic GPIO so you can add those extra I O pins to your circuit with ease Required Materials In order to follow along with this tutor...

Page 3: ...re a few options for each of those cable types SparkFun Qwiic Shield for Thing Plus DEV 16790 SparkFun Qwiic Shield for Arduino DEV 14352 SparkFun Qwiic Adapter DEV 14495 SparkFun Qwiic Shield for Ard...

Page 4: ...ok Up Wire Assortment Stranded 22 AWG PRT 11375 Qwiic Cable 200mm PRT 14428 Polarity An introduction to polarity in electronic components Discover what polarity is which parts have it and how to ident...

Page 5: ...tion on this functionality refer to section 8 3 2 in the TCA9534 datasheet and Example 4 Interrupt in the Qwiic GPIO Arduino Library Three hardware pins A0 A1 and A2 are dedicated I C address select p...

Page 6: ...CL GND and 3 3V on the Qwiic GPIO are broken out to a pair of Qwiic connectors as well as standard 0 1 spaced PTH pins for those who would prefer to solder to them The default I C address for the Qwii...

Page 7: ...state is closed This holds the Interrupt pin HIGH so it can be driven LOW when an interrupt event is monitored by the TCA9534 Open the jumper if you have another pullup on the Interrupt pin Address Ju...

Page 8: ...IO you will need to solder to them For a temporary connection for prototyping these IC Hooks are a great option to make that connection For users not familiar with through hole soldering take a look a...

Page 9: ...ns so you may want to refer to those for help with writing your own code using them Device Setup Settings bool begin TwoWire wirePort uint8_t address Initialize the TCA9534 on the I C bus If you have...

Page 10: ...ion we will go over those examples and highlight a few things to take note of when setting up your Qwiic GPIO in code Note If you are using the SparkFun Qwiic Micro SAMD21 Development Board as shown i...

Page 11: ...PIO_OUT GPIO_OUT GPI O_OUT GPIO_OUT Along with the pin mode we also need to define the initial state of each GPIO bool gpioConfig NUM_GPIO HIGH LOW HIGH LOW HIGH LOW HIGH LOW With the GPIO port config...

Page 12: ...d GPIO Port Example 2B demonstrates how to read the entire GPIO port on the TCA9534 The code sets up all eight GPIO pins just like Example 1B using a boolean but this time all pins are set as inputs W...

Page 13: ...l print LOW break Serial println n delay 100 Example 3A Inversion Example 3A shows how to invert the signal polarity of an input on the Qwiic GPIO Polarity inversion only works on pins configured as a...

Page 14: ...g processor interrupts on a microcontroller this tutorial will help you get started Example 4 demonstrates how to use the interrupt pin on the TCA9534 when any input pin registers a change The interru...

Page 15: ...nstead with a different development board or single board computer like the Raspberry Pi read on to the next two sections where we ll detail how to use the Qwiic GPIO Python Package Qwiic GPIO Python...

Page 16: ...allation To install make sure the setuptools package is installed on the system Direct installation at the command line use python for Python 2 python3 setup py install To build a package for use with...

Page 17: ...or copy the code into a file then open save the example file if needed and execute the code in your preffered Python IDE Qwiic GPIO Example 1 This example sets up all eight I O pins as outputs and to...

Page 18: ...IO mode_7 myGPIO GPIO_OUT myGPIO setMode while True myGPIO out_status_0 myGPIO GPIO_HI myGPIO out_status_1 myGPIO GPIO_HI myGPIO out_status_2 myGPIO GPIO_HI myGPIO out_status_3 myGPIO GPIO_HI myGPIO o...

Page 19: ...shows how to read each I O pin when they are configured as inputs It first sets up all pins using the setMode function as we did in Example 1 The code then monitors and prints out the status of each...

Page 20: ...e_5 myGPIO GPIO_IN myGPIO mode_6 myGPIO GPIO_IN myGPIO mode_7 myGPIO GPIO_IN myGPIO setMode while True myGPIO getGPIO This function updates each in_status_x variable print GPIO 0 end print myGPIO in_s...

Page 21: ...f of them using the setInversion self function As we covered in the Arduino Examples section each I O pin set as an input defaults to an active HIGH input so inverting it switches it to an active LOW...

Page 22: ...myGPIO GPIO_IN myGPIO setMode myGPIO inversion_0 myGPIO INVERT myGPIO inversion_1 myGPIO NO_INVERT myGPIO inversion_2 myGPIO INVERT myGPIO inversion_3 myGPIO NO_INVERT myGPIO inversion_4 myGPIO INVERT...

Page 23: ...at wraps up this Hookup Guide For more information about the Qwiic GPIO take a look at the following links Schematic PDF Eagle Files ZIP Dimensional Drawing PNG TCA9534 Datasheet PDF Hardware GitHub R...

Reviews: