ATtiny 85 is tiny processor which has only 8 pins, no USB although boards have USB port to power it and communicate with it. How can we deal with this real micro processor?
Chip only
If you have a chip only without any board you would have a programmer to burn your code in. The most easy way is to use your Arduino UNO board:
Where these pins are connected:
- ATtiny Pin 1 to Arduino Pin 10
- ATtiny Pin 5 to Arduino Pin 11
- ATtiny Pin 6 to Arduino Pin 12
- ATtiny Pin 7 to Arduino Pin 13
The capacitor between ground and RESET is 10µF.
or Leonardo:
Burning program to ATtiny 85
First upload the ArduinoISP example code to your Arduino. Dont't connect the capacitor and ATtiny yet.
Preparing Arduino IDE for ATtiny 85
You must have Arduino IDE version >= 1.6.4 to be able add another board layouts. Then you can in preferences dialog add a new URLs in Additional Boards Manager URLs. These URLs are comma separated list. For ATtiny you can use https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/packagedamellisattinyindex.json or http://digistump.com/packagedigistump_index.json for Digispark ATtiny boards with USB (see bellow).
Open Boards Manager in Board menu and pick ATtiny to install.
Next step is to connect the capacitor and ATtiny. Open Blink example code and change pin from 13 to 3.
- Select ATtiny
- Select 1MHz
- Leave serial port as is
- Select Tools -> Programmer -> Arduino as ISP
- Connecting LED with resistor to pin 2 => would blink.
From http://www.ernstc.dk/arduino/attiny85.html.
Board with USB
These boards are easier to program but don't expect classic USB port.
Next time we will focus on:
- USB-k drivers
- Windows 10 vs Mac
- setup ARduino IDE
- micronucleus
- example of volume knob