Created on: 17 July 2020
Part 2 of the Digispark Arduino Tutorial Series
This part of the Digispark Arduino tutorial series shows how to set up the Arduino IDE to program Digispark ATtiny85 boards in Windows 10. After setting up the software and drivers, the board is tested by loading a Blink sketch to it that blinks or flashes the on-board LED.
The basic steps that must be followed to program a Digispark board using the Arduino IDE in Windows 10 are 1) download and install the Arduino IDE, 2) install board support in the Arduino IDE, 3) install Windows drivers and 4) test the installation by loading a sketch to the Digispark board.
Digispark and compatible boards, as shown in the image below, can be programmed from the Arduino IDE in Windows 10 after following this tutorial.
Instructions in this tutorial are based on the Digispark programming instructions on the Digistump Wiki.
The following steps show how to set up a Digispark board for programming with the Arduino IDE in Windows 10.
Go to the Arduino website and download and install the Arduino IDE.
This can be done by either downloading and running the Windows Installer, or by downloading the Windows ZIP file. If the Windows ZIP file is downloaded, it must simply be unzipped, and the folder extracted to a convenient location, such as the Windows Desktop. Just open the extracted folder and double-click the Arduino executable file to start Arduino.
The image below shows the contents of the folder extracted from the downloaded zipped file, with the Arduino application selected. Simply double-click this file to start the Arduino IDE application.
Start the Arduino IDE application that you downloaded in the previous step.
From the top menu of the Arduino IDE application, select File → Preferences to open the Preferences dialog box.
Paste the following in the Additional Boards Manager URLs: box of the Preferences dialog box.
http://digistump.com/package_digistump_index.json
The image below shows the Additional Boards Manager URLs field of the Preferences dialog box.
Click the OK button to close the dialog box.
In the Arduino IDE, use the top menu to navigate to Tools → Board → Boards Manager... to open the Boards Manager dialog box.
Type Digispark into the search field at the top of the Boards Manager dialog box that contains the text "Filter your search..." to easily find the Digispark package.
After filtering the packages, Digistump AVR Boards is displayed in the Boards Manager dialog box. Click the Install button at the bottom right of the Digistump item in the dialog box, as shown in the image below.
After clicking the Install button, the package will start installing. This may take a while, depending on the internet speed.
When installation completes, click the Close button at the bottom right of the dialog box.
Download the Digispark Digistump Drivers for Windows.
Unzip the Digistump.Drivers.zip file downloaded from the above link and extract the Digistump Drivers folder from it.
Open the unzipped Digistump Drivers folder, as shown in the following image.
Double-click either DPinst64.exe on a 64-bit Windows computer, or DPinst.exe on a 32-bit Windows computer to install the Digispark drivers.
When prompted to install the driver with the following dialog box, click the Install button.
If a dialog box pops up that displays Windows can't verify the publisher of this driver software, click the Install this driver software anyway button.
After the driver installation has finished, click the Finish button in the Device Driver Installation dialog box.
Uploading a sketch to a Digispark board works differently from other Arduino boards. The board must not be plugged into a USB port, but must first be selected in the Arduino IDE. No port is selected. The sketch is uploaded, and when a prompt appears in the Arduino IDE, the board is plugged into a USB port. The following tutorial steps show how to load a sketch to a Digispark board.
The following sketch works on both Model A and Model B Digispark boards. The difference is that Model A boards have the on-board LED connected to pin 1, while the Model B boards have the on-board LED connected to pin 0.
Copy the following sketch and paste it into the Arduino IDE window. Save it as digispark_blink or a name of your choice.
void setup() { // Initialize the digital pin as an output pinMode(0, OUTPUT); // LED on Model B pinMode(1, OUTPUT); // LED on Model A } void loop() { digitalWrite(0, HIGH); // Turn the LED on digitalWrite(1, HIGH); delay(1000); // Wait for a second digitalWrite(0, LOW); // Turn the LED off digitalWrite(1, LOW); delay(1000); // Wait for a second }
From the top menu in the Arduino IDE, select Tools → Board → Digistump AVR Boards → Digispark (Default - 16.5MHz) to select the Digispark board.
Click the Arduino Upload button on the top toolbar before plugging the Digispark board into a USB port.
Wait for the prompt at the bottom of the Arduino IDE window, as shown in the following image.
When the prompt Plug in device now... (will timeout in 60 seconds) appears, plug the Digispark board into a USB port of the computer.
After the sketch finishes uploading, a success message running: 100% complete and >> Micronucleus done. Thank you! appears at the bottom of the Arduino IDE window, as can be seen in the following image.