Skip to content

WirelingZero Setup Tutorial

TinyCircuits WirelingZero product photo

This tutorial covers the basic setup for the WirelingZero, including all the software you will need and how to upload your first program with it.


Description

WirelingZero is one of TinyCircuits' second-generation processor boards, specifically designed for low-cost Wireling projects in the tiniest size. WirelingZero is based on the Atmel SAMD21 32-bit ARM Cortex M0+ processor (the same one used in the Arduino Zero / TinyZero / TinyScreen+ / RobotZero) and provides a USB connectivity port, power management, and battery charger in a single 15x32mm board.

Main Features:

  • Atmel SAMD21 processor (same as is used on the Arduino Zero)
  • More memory compared to TinyDuino (both Flash and RAM)
  • Power switch, regulator, lithium battery management on board
  • Precision clock crystal and Real-Time Clock hardware built-in, low power standby
  • 4 individually addressable I2C Wireling Ports
Technical Details
  • Atmel ATSAMD21G18A 32 bit ARM processor at 48MHz, Arduino Zero compatible
  • 32.728KHz clock crystal, RTC hardware built-in with standby mode down to 0.2mA
  • Ultra-compact size and weight (smaller than a US Quarter!)
    • 15mm x 32mm (.59 inches x 1.26 inches)
    • Max Height: 4.6mm (0.18 inches)
    • Ultra-thin 0.61mm (0.024 inches) PCB
    • Weight: 1.40 grams (0.049 ounces)
  • Atmel 32-bit ATSAMD21G18A ARM Microcontroller
    • ARM Cortex M0
    • 256KB Flash, 32KB SRAM
    • 12-bit ADC, 10-bit DAC
    • Default Clock speed: 48MHz
  • 2.7V – 5.5V operating voltage with built-in 3.3V regulator
  • Arduino compatible bootloader with CDC Serial port, plug and play on OSX and Windows 10
  • 4 individually addressable I2C Wireling Ports 

Notes

  • This processor board is designed for low-cost Wireling projects, so this board does not include the TinyShield expansion connector.
  • To send text to the Arduino IDE Serial Monitor, use the SerialUSB object instead of Serial
  • If you were able to upload a sketch to the WirelingZero and now it does not respond, you may need to force this into bootloader mode. To do this, plug a USB cable into the WirelingZero and your computer, and power off the WirelingZero using the slide switch. Then press and hold the button on the bottom on the WirelingZero while sliding the switch to the ON position. Select the new available COM# Port under the Tools tab, then try uploading your program to the WirelingZero and it should work. You may need to try this several times if it does not work the first time.

Materials

Hardware

Software


These are the steps this tutorial will cover to help you start using the WirelingZero:

  • Step 1. Configuring the Arduino IDE, so you have somewhere to write software that understands how to interface with your hardware
  • Step 2. Connecting to the WirelingZero board. This should just be a simple connection with a USB cable, and a few selections made in the Arduino IDE to ensure you are programming the correct board-type through the correct port of your computer.
  • Step 3. Uploading your first program to the WirelingZero. How exciting!
  • Troubleshooting/Bootloader mode: Reference this at any point throughout the tutorial if you are having issues. If this doesn't resolve your problems, you can look through past Forum posts, create your own, or email us for help at info@tinycircuits.com

Step 1: Configure Arduino Software IDE

  • Download and install the latest Arduino Software (IDE) from the Arduino website. (On Windows click Yes/Install when it asks 'Do you want to install this device driver/software?' You can also select the checkbox 'Always trust Arduino')

  • Open Arduino IDE and go to File->Preferences (Windows) or Arduino->Preferences (Mac OSX).

  • Copy and paste the following URL to the box that says 'Additional Boards Manager URLs': http://files.tinycircuits.com/ArduinoBoards/package_tinycircuits_index.json
  • Click 'OK'

  • Go to Tools->Board ->Boards Manager...

  • Select and 'Install' Arduino SAMD Boards (32-bits ARM Cortex-M0+). This may take a few minutes.

  • On the same Board Manager page, scroll down to select and 'Install' TinyCircuits SAMD Boards.

After those two packages are downloaded, you just need the Wireling Library. If you have not already downloaded the library from under the the Software section above, do that now and save the library to the proper folder. For some options on installing into a library, check out our Library Installation Help Page.


Step 2: Connect to WirelingZero

  • Connect the WirelingZero to your computer using the microUSB cable. At this point, make sure your WirelingZero's power switch is turned to ON.
  • Mac and Windows(10 and above) users can skip to the next step. Windows 7/8 users click here for device driver installation instructions before proceeding any further. (This link leads to drivers for the TinyScreen+) This driver is necessary for your computer to be able to communicate with and program the WirelingZero.
  • In the Arduino IDE, go to Tools->Board and scroll down to select WirelingZero.

  • Go to Tools->Port and select the port labeled TinyScreen+. The naming convention will usually look like:
  • Mac: “/dev/cu.usbmodemXXXX (TinyScreen+)”
  • Windows: “COMXX (TinyScreen+)”.

(The TinyScreen+ and WirelingZero share hardware similarities - the SAMD21 processor, so it makes sense that the port will be labeled 'TinyScreen+')*

  • Note: Some USB cables are used only for transferring power and not data signals. If your computer is not recognizing that a device is plugged in, you may need to try a different USB cable. If you've purchased a Micro USB Cable from our online store, you won't have to worry about this issue.
  • If you are having issues determining which port the WirelingZero is connected to, you can unplug the microUSB cable and plug it back in to note which COM## disappears and reappears during this process.

Now you are ready to upload your very first program to the WirelingZero!


Step 3: Upload Your First Program

The example program included with the Wireling library detects Wirelings attached to it's ports. You can open the program from the Arduino IDE under File/Examples/Wireling/WirelingScanner.

Or you can open it from your Folder Explorer under Documents/Arduino/libraries/Wireling/examples/WirelingScanner and double-click it to open in the Arduino IDE.

Wireling Program
//-------------------------------------------------------------------------------
//  TinyCircuits Wireling Basic Example
//  Last Updated 4 December 2019
//
//  This example shows how to scan for I2C devices on each port as well as print
//  out the state of the analog pin on each port.
//
//  Written by Ben Rose for TinyCircuits, https://TinyCircuits.com
//-------------------------------------------------------------------------------

#include <Wire.h>
#include <Wireling.h>

#if defined (ARDUINO_ARCH_AVR)
#define SerialMonitorInterface Serial
#elif defined(ARDUINO_ARCH_SAMD)
#define SerialMonitorInterface SerialUSB
#endif

void setup() {
  Wire.begin();
  Wireling.begin();
  SerialMonitorInterface.begin(9600);
}

void loop() {
  for (byte port = 0; port < 4; port++) {
    Wireling.selectPort(port);
    SerialMonitorInterface.print("Port ");
    SerialMonitorInterface.print(port);
    SerialMonitorInterface.print(": ");
    int nDevices = 0;
    for (byte I2Caddress = 1; I2Caddress < 127; I2Caddress++ )
    {
      if (I2Caddress != 0x68 && I2Caddress != 0x70) { // Ignore the multiplexer and RTC address
#if defined(_VARIANT_ROBOTZERO_)
        // On RobotZero, ignore the built in IMU, motor current setting digital potentiometer, and servo driver MCU
        if (I2Caddress != 0x1C && I2Caddress != 0x2F && I2Caddress != 0x6A) {
#endif
          Wire.beginTransmission(I2Caddress);
          if (!Wire.endTransmission()) { // This means that a device has acknowledged the transmission
            SerialMonitorInterface.print(" 0x");
            if (I2Caddress < 16) {
              SerialMonitorInterface.print("0");
            }
            SerialMonitorInterface.print(I2Caddress, HEX);
            nDevices++;
          }
#if defined(_VARIANT_ROBOTZERO_)
        }
#endif
      }
    }
    if (nDevices == 0) {
      SerialMonitorInterface.print("None\t");
    } else {
      SerialMonitorInterface.print("\t");
    }
    int portAnalogPin = A0 + port;
    if (digitalRead(portAnalogPin)) {
      SerialMonitorInterface.print("High");
    } else {
      SerialMonitorInterface.print("Low");
    }
    SerialMonitorInterface.print("\t");
  }
  SerialMonitorInterface.println();

}

This program works best if you have Wirelings to test with, as the Serial Monitor when opened will report the LOW/HIGH status, as well as the I²C address of any device on a given port (0-3). NOTE: Be mindful when inserting Wireling Cables - the connector pins inside the 5-pin connectors on Wirelings can be bent when cables are inserted at an angle.

If you ever encounter issues later on with Wirelings, you can come back to this program to make sure you are still receiving some type of signal from the port and device you are using.

Now you are ready to build any Wireling project!


Downloads


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!