BREAKING NEWS

03 November 2015

As Program ATtiny85 with Arduino

Scheduled-ATtiny85-Arduino

Foreword:
For the less experienced today we will talk about the family ATtiny or rather microcontrollers ATMEL just to remember it is a semiconductor manufacturing company founded in 1984.Questo tutorial will allow us to understand how to program an ATtiny85 with Arduino.
LIST OF MATERIALS:
  • ATtiny85


  • Breadboard  or Millefori
  • Arduino Uno
  • Jumper Male Male
What can we do:
The most useful is that once programmed the microcontroller will not use an Arduino for our projects, but rather only ATtiny85 and a few passive components. So we'll see the procedure for loading Arduino sketch and then the power of the classic LED.
Let us first the pin dell'Attiny85:
attiny85_pinout





While Arduino:
Pin 1 = Ain0 (D 5) PB5 
Pin 2 = Ain3 (D 3) PB3 
Pin 3 = AIN2 (D 4) PB4 
Pin 4 = GND 
Pin 5 = PB0 (D 0) PWM0 
Pin 6 = PB1 (D 1) PWM1 
Pin 7 = PB2 (D 2) INT0 Ain1 
foot 8 = VCC

This is useful because the ATtiny85, being very small, is used in projects where the dimensions are a fundamental requirement. Of course being shorty, its hardware features are limited, but still interesting. Here is a summary of the main specifications:
Program Memory 8 Kbyte EEPROM 512 Bytes SRAM 512 Byte Frequency 1MHz - 8MHz - 16MHz ADC 4-ChannelProtocol Serial SPI




a peculiarity of these microcontrollers is that they do not need to run the classic circuit resonator (quartz + capacitors) but can use a clock generator inside.
Once you downloaded and unzipped the download, go to the folder: Arduino and - if it does not exist - create a new folder and name it: Hardware. Copy here folders: tiny and tools that you have just downloaded.
If all went well, close and open again the Arduino IDE: go to the Tools menu> type of Arduino, and you should see a list of chip ATTiny. If you do not see them you have probably copied the folders in the wrong way.
boards-ATtiny85
AYou first load on our Arduino sketch by heading to the Files is an example called Arduino ISP: File> Examples> Arduino ISP
This sketch is very important, because it "transforms" into an Arduino chip programmer. Once loaded the sketch, we are ready to connect the Arduino to the breadboard.
ATtiny connection to Arduino
Scheduled-ATtiny85-Arduino
Now that our Arduino became a programmer ISP just load a sketch and pass sull'ATTiny85.
For loading the code directly on the chip, go to: Tools> and select the type of Arduino chip ATtiny85 - do not have to select Arduino! If you do not know which of several chip select, try the one with the lowest frequency: @ 1MHz. The chip should work at 8MHz.
Now open: Tools> Programmer and choose Arduino as ISP. Loaded the sketch given below.
void setup ()
{
  // PIN0 output
  // The PIN0 corresponds to PIN5 dell'ATtiny85
  // See diagram
  pinMode (0, OUTPUT);
}

void loop ()
{
  // LED on-off every half second
  delay (500);
  digitalWrite (0, HIGH);
  delay (500);
  digitalWrite (0, LOW);
}
Click on the upload button to upload the sketch sull'ATtiny85. The LED TX and RX of the Arduino UNO board will flash indicating the firmware loading sull'ATtiny85. After a few moments, if there are no problems typical autoreset (surmountable using the classic capacitor put between the GND and pin / Reset) on the IDE window should appear confirming the Done uploading, with the following warning:
avrdude: please define PAGEL and BS2 signals in the configuration file for ATtiny85 part 
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
We can ignore them because they do not affect the procedure.
We connect the LED with a resistance to make sure everything is done correctly
ATiny-Example


Share this:

Post a Comment

 
Back To Top
Distributed By Blogger Templates | Designed By OddThemes