MacOS 10.15.6
Windows 10
Arduino 1.8.13
Arduino 1.8.13
Goals:
- Install drivers and libraries to develop firmware for the ATTiny85 Microcontroller using Arduino IDE, including the ATTiny85 chip alone (uploading firmware using Arduino Uno) and also ATTiny85 Dev Board.
ATTINY85 Features:
- PB3 - OWOWOD - One Wire / One Way Output for Debugging library. It allows you to output text from the ATtiny85 microcontroller or other similar, though USB-to-Serial or TTL converter and to the computer screen using COM port monitoring tool.
- Watchdog timer
- The reset pin can also be used as a (weak) I/O pin.
Name | Features |
---|---|
CPU Architecture and Speed | 8-bit RISC Architecture, 1 MIPS@1MHz |
CPU Frequency | 0-8MHz Calibrated Internal R-C Oscillator |
Operating Voltage Range | +1.8V to +5.5V (ATTINY85V) +2.7V to +5.5V (ATTINY85) (+6.0V being absolute maximum supply voltage) |
GPIO PORTS | 6 GPIO Pins in total |
Interrupts | One External interrupt on INT0 – PB2 - Pin7 |
Timers |
|
PWM | 3 PWM pins (PB0, PB1 and PB4) |
Maximum DC Current per I/O Pin | 40 mA |
Maximum DC Current through VCC and GND Pins | 200 mA |
SPI | One SPI communication channel with pins: MOSI – GPIO5, MISO – GPIO6, SCK – GPIO7 |
I2C | One I2C channel |
Operating Temperature | -55ºC to +125ºC |
ADC | 4 Pins 10-bit ADC (PB2, PB3, PB4 and PB5) |
DAC | No Available |
Enhanced USART Module | 1 Channel |
SRAM | 256 bytes |
FLASH ( Program Memory) | 8K bytes [10000 write/erase cycles] |
EEPROM | 512 bytes |
Comparator | one analog comparator with input pins as AIN0 – GPIO5 AIN1 – GPIO6 |
Low power consumption | Active Mode: 1 MHz, 1.8V: 300 μA Power-down Mode: 0.1μA at 1.8V |
Install:
- By default the Arduino IDE does not support the ATtiny85. So, we need to add support for the ATtiny85 to the Arduino URL Board Manager:
- Arduino -> Preferences -> Additional Board Managers URLs
- Copy & paste the following URL (if you already have a board manager URL just add a comma before pasting):
- https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
- Also add the URL to support digistump:
- http://digistump.com/package_digistump_index.json
- Restart the Arduino IDE
- Install the ATtiny Board Package:
- Tools -> Board -> Boards Manager
- Install attiny board package
- Install Sensor Libraries:
- Sensor NRF24L01:
- NRFLite Library:
- Arduino -> Sketch -> Include Library -> Library Manager
- Install NRFLite library by Dave Parson
- Prepare Arduino Uno to upload the code to the ATTINY85 microcontroller:
- Set the Arduino Uno Into ISP Mode:
- We will need to "prep" the Arduino fist by uploading the ISP sketch to it.
- Arduino IDE select File -> Examples -> 11. Arduino ISP-->ArduinoISP
- The ISP sketch should open and upload it to your Arduino Uno
- Arduino - Attiny85 wiring:
- Making the ATtiny85 Arduino Compatible:
- It's required to burn the Arduino bootloader onto the chip to make sure the chip will accept any programs uploaded via the Arduino IDE.
- Tools -> Board scroll to the bottom select ATtiny25/45/85
- Tools -> Processor -> ATtiny85
- Tools -> Clock -> 8 MHz (internal)
- Tools -> Programmer -> Arduino as ISP
- Check that all wiring, capacitor, and board selections are correct
- Finally select Burn Bootloader
- Uploading the Sketch to Attiny85 chip:
- Tools -> Board scroll to the bottom select ATtiny25/45/85
- Tools -> Processor -> 8 MHz (internal)
- Tools -> Programmer -> Arduino as ISP
- Upload the sketch
Testing:
References:
- ATTiny85 Microchip Datasheet
- ATtiny85 Datasheet
- Use an ATtiny85 with Arduino IDE
- Installing AT Tiny support
- How to Program an Attiny85 From an Arduino Uno
- AT Tiny85: Introduction to Pin Change and Timer Interrupts
- Programming ATtiny85 with Arduino Uno
- Attiny85 Atmel - Arduino Bootloader
- Connecting and Programming Your Digispark
- Support for Atmel AVR ATtiny family of microcontroller to the Arduino IDE
- ATtiny85 Microcontroller Pinout Datasheet
- ATtiny85 Microcontroller