The ATtiny85 has 512 Bytes of RAM and 8kBytes of flash. A quarter as much as an Arduino Uno board. It also has 512 Bytes of EEPROM, useful for temporary data. Documentation available.
The designers provide a schematic diagram. We see PB1 has a a built-in LED. PB2 and PB3 are connected to USB+ and USB- with resistors and protective diodes. PB5 is free to use as an IO because the bootloader does not use the reset pin.
Much more getting started information at the website.
We need to add an Additional URL to our Arduino Preferences. Menu File->Preferences.
Select a comfortable font size and tick boxes for Show verbose output during: compilation and upload.
In the box for Additional Boards Manager URLs: add this line:
http://digistump.com/package_digistump_index.json
Make sure you click OK to save this value. You may see a warning message in your IDE.
Menu Tools->Boards Manager to add new board packages.
Search for Digistump AVR Boards and install package.
Menu Tools->Board: "Digispark (Default - 16.5mhz)"
Check and confirm selection of micronucleus programmer.
We now have a large selection of example sketches made for the Digispark board. The board comes with a blink demo program. Let's use this blink which changes the speed of the blinking.
void setup(){ pinMode(1,OUTPUT); }
void loop() { digitalWrite(1,HIGH) ; delay(500);
digitalWrite(1,OUTPUT); delay(200);
digitalWrite(1,HIGH) ; delay(200);
digitalWrite(1,OUTPUT); delay(200); }
Click the checkmark in the menu bar and verify the program can compile. Because we chose Verbose Output during Compilation we see the process details.
Driver for Digispark BootloaderLike an Arduino board the Digispark has a bootloader. A small program placed in the flash that runs first. It looks at the USB com port just like a Uno. When your PC has a sketch to upload the bootloader copies it into flash and starts running the program.
Your PC does not recognize this USB device and we have to install a driver. We can find a program in the board files we downloaded. Select folder options view see hidden files.
Starting at your account home folder find Arduino15\packages\digistump\tools\micronucleus\2.0a4\ and you will see two driver files: DPinst and DPinst64. Run either one and accept default prompts.
Click Install for any device software. Notice it is for Digispark Bootloader from Digistump.
Mine worked despite the error message.
Now the Digispark board is recognized by Windows and we can upload a sketch.
You can also install this driver with a program called Zadig. Or download Windows drivers from github.
Take the board outResetting the board happens at powerup. We will be prompted when we need to re-insert.
Upload the normal wayArrow button or Sketch->Upload. You have 60 seconds to plug the board in and the sketch to upload automatically.
We selected Verbose output on Upload and we can read the actual commands used.
Repeat this program with different delay times.
Look at the examples installed with the board files. Having a working USB port is a useful feature.
Comments