User Tools

Site Tools


digispark:tutorials:connectingpro

This is an old revision of the document!


Connecting and Programming Your Digispark Pro

Bootloader:

The bootloader is the code that is pre-programmed on your Digispark and allows it to act as a USB device so that it can be programmed by the Arduino IDE.

The Digispark runs the micronucleus bootloader version 2, an open source project https://github.com/micronucleus.

CAUTION We are not at this point supporting upgrading the firmware, so if you decide to, you do so entirely at your own risk.

Software:

The Digispark Pro uses the Arduino IDE - Digistump Release 1.5.x which is the Arduino IDE with some custom additions and supports Digispark, Digispark Pro, and DigiX. These are presented as a fully integrated package with 1.5.x that can be downloaded as an installed or zip file.

First download the appropriate package:

Windows Install

  • Complete these steps before plugging in the Digispark (Pro)
  • Installer: Run the installer, when it pops up the driver install, install the drivers as well. When complete run the “Arduino IDE - Digistump Release” from your start menu.
  • Zip: Unzip and run the driver install - which is the “Install Drivers.bat” file inside the drivers folder. Then run Arduino.exe to run the IDE.

Mac OS X Install

  • Disable Gatekeeper by following this tutorial: Disabling Gatekeeper on OSX
  • Unzip the App and drag it to your Programs folder - or whereever you would like to store it.
  • Run the “Arduino - Digistump Release” App that you just unzipped.
  • See the troubleshooting section below for any other issues.

Linux Install

  • Untar
  • If you haven't before - Install the udev rules found here: Troubleshooting section
  • Run the arduino executable

Using the Digispark with the Arduino IDE:

The Digispark (and Pro) works a bit differently than some Arduino compatible products. Not only is there a special add-on to the IDE to support it, but it also programs with a different procedure.

From the Tools menu select Board→Digispark Pro (16Mhz) (Default)

(The Tools→Programmer selection does not matter)

Write some code, open your code, or open a Digispark example.

You do not need to plug in your Digispark Pro before invoking upload

Hit the upload button. The bottom status box will now ask you to plug in your Digispark Pro - at this point you need to hit the reset button on it or plug it in.

You'll see the upload progress and then it will immediately run your code on the Digispark Pro.

If you unplug the Digispark Pro and plug it back in or attach it to another power source there will be a delay of 5 seconds before the code you programmed will run. This 5 second delay is the Digispark Pro checking to see if you are trying to program it. After the 5 second delay when the bootloader launches the stored program, the USB device will typically go away (and may report a failure to install, or “Unknown Device”) unless the nature of the 'sketch' is to act as a USB device.

Your first upload:

If you're just getting started try the above procedure with the following example

Here is the code it will load:

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(1, OUTPUT); //on board LED 
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(1, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

This code will blink the BUILT IN LED on Pin 1

As soon as it has uploaded you should see the LED start to blink!

Precautions:

The Digispark Pro, due to its small size and low cost is not as robust as a full blown Arduino.

The Digispark Pro does not have reverse polarity protection. Connecting power to the Digispark Pro power pins backwards will almost certainly destroy it.

The Digispark Pro does have a 0.5A fuse for both the USB and VIN lines - this should safeguard it from brief shorts - but is not by any means a failsafe.

The Digispark Pro is small enough to present a choking hazard and small enough to be inserted into some sockets. We take no responsibility for misuse of the product. Please treat electricity and electronics with respect and common sense.

Troubleshooting:

The Digispark Pro pushes affordable, small components to their limits by using software to emulate USB functions generally served by a dedicated chip. For this reason much of the Digispark's USB operation is considered borderline out of spec. Certain laptops, older machines, and just some cheaply made USB hubs/controllers do not like this. We tested and designed the Digispark Pro for maximum compatibility but we can not guarantee it will work with everything.

In addition remember the Digispark Pro only shows up as a programmable device for 5 seconds, after that it will start running its code (when it is new and un-programmed this means it will blink) and disappear or act like the USB device you programmed it to act like.

Always remember plug in or restart the Digispark Pro when the Arduino IDE requests you to.

If the computer will not recognize the Digispark Pro try the following:

  • Try connecting it to another USB port or system.
  • [USB 2 on Windows may be better]
  • Try connecting it to the rear ports (if a desktop)
  • Try connecting it to a USB hub.
  • Try a powered USB hub.
  • Use a different cable, especially if system ignores the device.

If it won't upload:

Did you set your board AND programmer to Digispark in the Arduino IDE?

WINDOWS:

  • Did you install the driver?
  • For the example programs if you are getting “Device not found” even after installing the DigiUSB driver in the examples folder then try this: http://digistump.com/board/index.php/topic,257.0.html
  • If Windows does not recognize a “DigiUSB” but a generic “HID-compliant device”/“USB Input Device” pair, go to the Device Manager, find in the “Human Interface Devices” category the USB Input Device with a vendor ID of 0x16C0 and select “update driver” / “browse my computer” / “let me pick from a list” and the DigiUSB should show up there.

MAC

  • If the Arduino application works fine but the computer does not recognize the Digispark after you are asked to plug it in - try a usb extension cable or hub, some MacBook's ports are recessed too far for the data connectors to make contact.
  • If the Arduino application won't start (especially an error like: “Arduino” is damaged and can't be opened.) or the upload fails try allowing all unsigned code to be run: See the “How to change Gatekeeper settings to allow or disallow unidentified apps” section on this page: http://www.imore.com/how-open-apps-unidentified-developer-os-x-mountain-lion
  • If you're getting the error above and allowing unidentified apps doesn't fix it try this: http://digistump.com/board/index.php/topic,119.0.html - we are actively working on a fix for this issue.
  • 2012 MBP The USB ports on the 2012 MBPs (Retina and non) cause issues due to their USB3 controllers, currently the best work around is to use a cheap USB hub (non USB3) - we are working on future solutions. The hub on a Cinema display will work as well.

LINUX: See the Linux troubleshooting page

If your upload fails in the middle of it, you may also be using a bad USB cord and or a bad hub.

Support requests are best posted to the forum, so everyone can benefit and we can help eachother through any issues - http://digistump.com/board

digispark/tutorials/connectingpro.1419199387.txt.gz · Last modified: 2014/12/21 14:03 by digistump