Wednesday, December 31, 2014

A first look at the Digispark Pro

The ATTiny85 Arduino in my last post was based on the Paperduino - which in turn is based on the Digispark board from  They had a Kickstarter campaign going for the Digispark Pro kit. You could order these tiny Arduino compatible microcontroller boards along with an impressive array of shields. I ordered a couple of Pro boards along with a few different shield kits and they finally arrived a few weeks ago. I've had a bit of spare time so I was able to put together a couple of shields and try out this board.

Pictured are the Digispark Pro board, DigiLED shield and Charlieplex shield.

The Digispark Pro board comes ready to use. You can solder on some supplied female headers to do prototyping or to plug in shields. The USB connection is USB Micro-B. Like the ATTiny 85 the board is unplugged when you start uploading and plugged in when the IDE gives the prompt message. And just like the ATTiny 85, some of the i/o lines, pins 3 & 4 in this case,  are also used for serial communication which means that some circuits will interfere. When this happens the circuit or shield needs to be disconnected during upload and then reconnected after the software is loaded. This can slow down debugging. This board uses an Atmel Attiny85 MCU with about 6 KB of flash memory.

The DigiLED shield kit comes with what looks like an RGB LED. In fact the device is a smart RGB LED or WS2812 compatible LED. These LEDs have become very popular with hobbyists because they contain registers and other circuitry that allows them to be daisy chained. A large number of LEDs can be controlled using just 3 wires! Power, Ground and Data. The price of these LEDs is under a dollar. In fact you can buy a NeoPixel ring with 60 LEDs prewired. The provided code is hard on the eyes. Its easy to make loops that fade each colour in and out for a more pleasing demo.

The Charlieplex shield shows how to control 20 LEDs using just 6 data lines. The Charlieplex trick is to remember that a digital i/o pin can have 2 states in Output, 0 or 1 (ground or +V) and that when set as "Input" the pin really has a third state called Hi Z or high impedence. In the Hi Z input state the pin acts as neither ground or +5 V and more like an open circuit. The Charlieplex LEDS are cleverly wired so that each LED is separately addressable via a combination 1 Hi output and 1 Low output while keeping the rest of the pins at Hi Z.

The Digispark Pro board looks like it could be used in the classroom as long as the students are careful and patient. The low price means that the odd burn out won't be a major pain to the budget. It will be interesting to see how the unit fairs doing some of the basic Arduino tutorials we use in grade 10 and 11.

Monday, December 1, 2014

ATTiny85 Arduino part 2, One Potato, Two Potato, Three Potato, more

I put the ATTiny85 Arduino project aside for a few weeks and when I picked up my circuit board again I used another laptop, my trusty Samsung Netbook actually. I followed procedure carefully and sure enough it worked first time and every time! I made a few minor adjustments to the PCB pattern and printed off some copies for my grade 12 Computer Studies class. We etched the boards using the Toner Transfer method and got some good looking PCBs. A few days later the components were soldered onto the boards and the Boot Loader burned into a bunch of ATTiny85 chips. Next thing you know: one potato, two potato, three potato more -

Congratulations to the grade 12 class that built these. Excellent work.

Here are the instructions I gave to the class:

Manufacture the circuit board using the trace layout given following the classroom procedure. You may want to add 1/8 inch holes in each corner so that your board can be mounted using 4/40 screws at a later date.

Familiarize yourself with the schematic diagram and parts placement.
Identify the following parts:
  • USB signal
  • Power
  • Reset
  • i/o

Place the components and solder them in place in the following order. Clip the excess leads after each set of components is soldered.
  • Capacitors
  • 8 pin socket
  • 1.5kΩ resistors
  • 1N4148
  • 22Ω resistors
  • 3.6V zener diodes
  • LEDs
  • reset pushbutton
  • 9 pin header
  • USB socket

Use a multimeter to check for shorts between traces. Notice that the USB power and signal traces are very close together and a USB short could affect your computer. If there are no shorts connect your Atiny85 Arduino via USB to a laptop for a moment. The green power LED should glow (and hopefully nothing else will happen).

Unzip the Digispark Arduino IDE and locate the directory in the installs directory on a school laptop.

Use the InstallDriver utility inside /DigisparkArduino-Win32/DigisparkWindowsDriver to install the driver.

Run the Arduino IDE inside of /DigisparkArduino-Win32/Digispark-Arduino-1.0.4/
  • Do not connect your Atiny85 Arduino to the computer yet.
  • Under Tools choose Board and choose Digispark (Tiny Core).
  • Under Tools choose Programmer and choose Digispark.
  • Under File choose Examples and choose Digispark_Examples and choose Start.
  • Click the upload button and watch the message area at the bottom of the IDE.
  • Plug in your Atiny85 Arduino when the “Plug in device now . . .” message appears. Pin1 (sometimes called PB1) is pin 6 on the chip. Your built in red LED is connected to this pin. The program should cycle the LED on and off at 1 Hz.

Handy Reference Chart
pin Pin Analog
1 Reset

2 3 Input 3
3 4 Input 2
4 Gnd

7 2 Input 1, SCK

Here is a pdf file containing a sheet of  16 pcb layouts.