Installing Attiny13 core files in Arduino IDE 1.6.x and 1.7.x

Note! Currently I suggest you follow the instructions here, to install via the boardmanager

The installation for the Attiny13 in the Arduino IDE 1.0x was  fairly straightforward and is described in my ibble.
The Arduino IDE from Version 1.6  and newer, have a different structure for choosing the processor-board: Under ‘Tools’ you have to seperately choose the board, the processor and the speed. If you have installed the MIT cores for attiny 44-84 and 45-85, under ‘Tools-Board’ you will see a seperate class for  ‘Attiny’ processors, while under ‘Tools-Processors’ you will be able to choose for an  attiny85/45 or attiny44/84. You will however no longer see your attiny13 core there.

In order to be able to select the attiny13 again you need to put it in the new file structure.
I will describe that for the Smeezekitty core.

First, close your IDE, as any changes will need a restart anyway.
Download the Smeezekitty core. You will get a file called Core13-20.zip that contains 15 files but no boards.txt file.

Open your explorer and go to your hardware folder, that is located in your sketches folder. In the hardware folder you should see  the folder ‘attiny'(if you have the MIT attiny core installed). If it doesn’t exist, create it. If you open the attiny folder you will see a folder called “avr” open that one. If it doesn’t exist, create the folder “avr”. When you open it, you will see a  folder ‘variants’ and the “boards.txt” file. If they do not exist, create them.
open the folder variants. You probably will see 2 folders called “tiny8” and “tiny14”. Create a folder called ‘Core13’
Open  the downloaded Smeezekitty core and put the  15 files directly in the ‘Core13’ folder. Not in a subfolder

If you already have the smeezekitty core installed for the  Arduino IDE 1.0x  then copy that folder – that is likely called ‘core13’- in the ‘variants’ folder.

Go back to the  ../hardware/attiny/avr/ folder and make a copy of the boards.txt, then open the boards.txt and add the following lines at the bottom:
#################################################
attiny.menu.cpu.attiny13=ATtiny13
attiny.menu.cpu.attiny13.upload.maximum_size=1024
attiny.menu.cpu.attiny13.build.mcu=attiny13
attiny.menu.cpu.attiny13.build.variant=core13

attiny.menu.clock.internal96=9.6MHz (internal)
attiny.menu.clock.internal96.bootloader.low_fuses=0x7A
attiny.menu.clock.internal96.bootloader.high_fuses=0xff
attiny.menu.clock.internal96.build.f_cpu=9600000L
################################################

attiny.menu.clock.internal48=4.8MHz (internal)
attiny.menu.clock.internal48.bootloader.low_fuses=0x79
attiny.menu.clock.internal48.bootloader.high_fuses=0xff
attiny.menu.clock.internal48.build.f_cpu=4800000L
################################################

If you had to create your boards.txt file yourself Then make sure you add at the top the following lines:
##############################################
menu.cpu=Processor
menu.clock=Clock

attiny.name=ATtiny
attiny.bootloader.tool=arduino:avrdude
attiny.bootloader.unlock_bits=0xff
attiny.bootloader.lock_bits=0xff
attiny.build.core=arduino:arduino
attiny.build.board=attiny
attiny.upload.tool=arduino:avrdude
##############################################

save the boards.txt file and start your Arduino IDE 1.6.x or 1.7.x. Go to Tools-Board and select ‘Attiny’. Then go to ‘Tools-Processor’ and check if the Attiny13 is present. Go to ‘Tools-Clock’ and check for 4.8 MHz and 9.6MHz (internal).

Anyway, just to make sure you have the right folder stucture: this is what you should have:
…/hardware/attiny/avr/variants/core13/(some 15 files)
…/hardware/attiny/avr/boards.txt

NOTE: If on burning the bootloader to set the proper fuses you get an ‘efuse’ error, that is because teh boards.txt defines the root core as “Arduino” that might be fine for the 25/45/85 series as they have an extended fuse. But the Attiny13 has not. Changing it in the  ‘variants’ section apparently is not enough. You then have to give the attiny13 its own menu section. You do that like this:
###############################
menu.cpu=Processor
menu.clock=Clock

attiny13.name=Attiny13
attiny13.bootloader.tool=arduino:avrdude
attiny13.bootloader.unlock_bits=0xff
attiny13.bootloader.lock_bits=0xff
attiny13.build.core=arduino:core13
attiny13.build.board=attiny
attiny13.upload.tool=arduino:arduinoisp

#########################

attiny.name=ATtiny45/85
attiny.bootloader.tool=arduino:avrdude
attiny.bootloader.unlock_bits=0xff
attiny.bootloader.lock_bits=0xff
attiny.build.core=arduino:arduino
attiny.build.board=attiny
attiny.upload.tool=arduino:avrdude

attiny.menu.cpu.attiny45=ATtiny45
attiny.menu.cpu.attiny45.upload.maximum_size=4096
attiny.menu.cpu.attiny45.build.mcu=attiny45
attiny.menu.cpu.attiny45.build.variant=tiny8

attiny.menu.cpu.attiny85=ATtiny85
attiny.menu.cpu.attiny85.upload.maximum_size=8192
attiny.menu.cpu.attiny85.build.mcu=attiny85
attiny.menu.cpu.attiny85.build.variant=tiny8

attiny.menu.cpu.attiny44=ATtiny44
attiny.menu.cpu.attiny44.upload.maximum_size=4096
attiny.menu.cpu.attiny44.build.mcu=attiny44
attiny.menu.cpu.attiny44.build.variant=tiny14

attiny.menu.cpu.attiny84=ATtiny84
attiny.menu.cpu.attiny84.upload.maximum_size=8192
attiny.menu.cpu.attiny84.build.mcu=attiny84
attiny.menu.cpu.attiny84.build.variant=tiny14

attiny.menu.clock.internal1=1 MHz (internal)
attiny.menu.clock.internal1.bootloader.low_fuses=0x62
attiny.menu.clock.internal1.bootloader.high_fuses=0xdf
attiny.menu.clock.internal1.bootloader.extended_fuses=0xff
attiny.menu.clock.internal1.build.f_cpu=1000000L

attiny.menu.clock.internal8=8 MHz (internal)
attiny.menu.clock.internal8.bootloader.low_fuses=0xe2
attiny.menu.clock.internal8.bootloader.high_fuses=0xdf
attiny.menu.clock.internal8.bootloader.extended_fuses=0xff
attiny.menu.clock.internal8.build.f_cpu=8000000L

attiny.menu.clock.external8=8 MHz (external)
attiny.menu.clock.external8.bootloader.low_fuses=0xfe
attiny.menu.clock.external8.bootloader.high_fuses=0xdf
attiny.menu.clock.external8.bootloader.extended_fuses=0xff
attiny.menu.clock.external8.build.f_cpu=8000000L

attiny.menu.clock.external16=16 MHz (external)
attiny.menu.clock.external16.bootloader.low_fuses=0xfe
attiny.menu.clock.external16.bootloader.high_fuses=0xdf
attiny.menu.clock.external16.bootloader.extended_fuses=0xff
attiny.menu.clock.external16.build.f_cpu=16000000L

attiny.menu.clock.external20=20 MHz (external)
attiny.menu.clock.external20.bootloader.low_fuses=0xfe
attiny.menu.clock.external20.bootloader.high_fuses=0xdf
attiny.menu.clock.external20.bootloader.extended_fuses=0xff
attiny.menu.clock.external20.build.f_cpu=20000000L

#################################################
attiny13.menu.cpu.attiny13=ATtiny13
attiny13.menu.cpu.attiny13.upload.maximum_size=1024
attiny13.menu.cpu.attiny13.build.mcu=attiny13
attiny13.menu.cpu.attiny13.build.variant=core13

attiny13.menu.clock.internal48=4.8MHz (internal)
attiny13.menu.clock.internal48.bootloader.low_fuses=0x7A
attiny13.menu.clock.internal48.bootloader.high_fuses=0xff
attiny13.menu.clock.internal48.build.f_cpu=4800000L

attiny13.menu.clock.internal96=9.6MHz (internal)
attiny13.menu.clock.internal96.bootloader.low_fuses=0x79
attiny13.menu.clock.internal96.bootloader.high_fuses=0xff
attiny13.menu.clock.internal96.build.f_cpu=9600000L

################################################
attiny.menu.cpu.attiny2313=Attiny2313
attiny.menu.cpu.attiny2313.upload.maximum_size=2048
attiny.menu.cpu.attiny2313.build.mcu=attiny2313
attiny.menu.cpu.attiny2313.build.variant=attiny2313

attiny.menu.clock.internal8=8 MHz (internal)
attiny.menu.clock.internal8.bootloader.low_fuses=0xE4
attiny.menu.clock.internal8.bootloader.high_fuses=0xDF
attiny.menu.clock.internal8.bootloader.extended_fuses=0xFF
attiny.menu.clock.internal8.build.f_cpu=8000000L

Everything should be ok now but if you experience problems with delay and mills functions, you may still have an old Arduinocore. Check the code in hardware/arduino/cores/arduino/wiring.c, and find this section:

#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
SIGNAL(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
#endif

The header file for the attiny13 (iotn13.h) shows the interrupt macro for timer overflow for attiny13 to be TIM0_OVF_vect and not TIMER0_OVF_vect. The fix is adding an additional OR condition:

#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || (__AVR_ATtiny13__)
SIGNAL(TIM0_OVF_vect)
#else
SIGNAL(TIMER0_OVF_vect)
#endif

41 thoughts on “Installing Attiny13 core files in Arduino IDE 1.6.x and 1.7.x

  1. HI!
    Hi followed all of your steps but the blink sketch does not work o the attiny13.
    I downloaded the core13 folder and placed it in “variants”. Then i attached your first code at the bottom of the board file. The code compiles and can be uploaded on the attiny13 but if i want to blink a led it will stay on forever (obviuosly i checked if the pin were the right one). This for every clock value

    I also tried to make a board.txt like your last code posted but, when compiling, it says: “avr-gcc: error: core.a: No such file or directory” for every clock value.

    I also tried the code in the link of the last comment and the compiler says: “In the platform.txt of third parts compiler.path is not defined”

    1. that last error I have never come across.
      Which version of the IDE are u using?
      At what speed did you burn your bootloader? (not at what speed did you program yr attiny but at what speed did u burn the bootloader)

  2. Hello,
    I do have the same error as Dario.
    avr-gcc: error: core.a: No such file or directory
    It doesn’t make a different if there is an example sketch or another.

    Some weeks ago I needed to flash a Attiny85. That was the reason, I installed the solution on this way: http://highlowtech.org/?p=1695

    I wrote https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
    into the field.

    Everything works fine. I am using Ubuntu and Arduino IDE 1.6.4

    My folders are a bit different to your description. They are:

    …/hardware/tinyUSBboard/avr/variants/core13/(some 15 files)
    …/hardware/tinyUSBboard/avr/boards.txt

    If I rename it to …/hardware/attiny/avr/variants/core13/(some 15 files)
    the arduino IDE does not start.

    1. Thanks for the info. In fact your folder structure is the same as mine it is just that you have given the board folder another name.
      From your comment it is a bit unclear where you have the problem with and wether or not you have solved it now. The damellis json link that you got from highlowtech is in fact how you install the attiny85 core files in the Arduino1.6.x IDE and yes, that works.
      There is however no Json file for the Attiny13 core, hence my description of how to do that manually.
      If ofcourse you start renaming folders but do not do that in your boards.txt file as well, yes then you get the avr-gcc error.
      Anyway, as said it is a bit unclear to me if you now still have a problem with the attiny13 core or not.

      1. I have no experience with json’s at all, other than using the ones that are provided.
        However, If I would be experienced, I would make it to follow the same directory structure as I describe here, So it is jus a matter of creating the proper directory structure, as i describe and putting the files in there. As far as I know that is all a json for additional boards does. But if I knew how to write a json I would have already for this core.

  3. Hello,

    I still have the problems. When I want to compile the sketch the error appears.
    I do not give the board folder name. It was automatically given.

    Could you please tell me what I have to change in the boards.txt? I can’t find a folder structure which I have got to change.

    1. what exactly did create that foldername? I am getting confused because what i describe is the manual install of the attiny13 core.
      What does yr borads.txt file look like?
      and what exactly now is it that u are installing?

  4. Hi!

    First I want to thank you for your tutorial.
    I’m using Arduino IDE 1.6.4 with an Arduino Uno to program an ATtiny13-20PU.

    I’m able to load the blink example to the ATtiny, but the the delay-function does not work.

    I get the error that you mentioned above (“efuse” memory type not defined for part “ATtiny13”).
    So I copied the code to the boards-file to give it an own section. Now it has it’s own section in the Arduino IDE but it still doesn’t work. I still get the same error when I try to burn the bootloader.

    Can you help me, please?

    1. Have you copied that correction exactly as i said? Somehow you seem to still define an efuse for the attiny13,otherwise it wouldnt generate that error. doublecheck the boards.txt file. Are u sure that is the correct one and the only one being used?
      Does it now have its own section under “Tools-boards”

      1. Yes I copied it exactly as you said.
        I discovered that I have two hardware-folders:
        C:\Program Files (x86)\Arduino\hardware\arduino\avr
        C:\Users\*user*\Documents\Arduino\hardware\attiny\avr

        I changed the boardsfile within the attiny-folder and it looks like this now: (i still get the same error, my board works with an attiny45, so the board should not be the problem)

        ##############################################
        menu.cpu=Processor
        menu.clock=Clock
        attiny.name=ATtiny
        attiny.bootloader.tool=arduino:avrdude
        attiny.bootloader.unlock_bits=0xff
        attiny.bootloader.lock_bits=0xff
        attiny.build.core=arduino:arduino
        attiny.build.board=attiny
        attiny.upload.tool=arduino:avrdude
        ##############################################

        #################################################
        attiny.menu.cpu.attiny13=ATtiny13
        attiny.menu.cpu.attiny13.upload.maximum_size=1024
        attiny.menu.cpu.attiny13.build.mcu=attiny13
        attiny.menu.cpu.attiny13.build.variant=core13
        attiny.menu.clock.internal96=9.6MHz (internal)
        attiny.menu.clock.internal96.bootloader.low_fuses=0x7A
        attiny.menu.clock.internal96.bootloader.high_fuses=0xff
        attiny.menu.clock.internal96.build.f_cpu=9600000L
        ################################################

        attiny.menu.clock.internal48=4.8MHz (internal)
        attiny.menu.clock.internal48.bootloader.low_fuses=0x79
        attiny.menu.clock.internal48.bootloader.high_fuses=0xff
        attiny.menu.clock.internal48.build.f_cpu=4800000L
        ################################################

        ###############################
        menu.cpu=Processor
        menu.clock=Clock
        attiny13.name=Attiny13
        attiny13.bootloader.tool=arduino:avrdude
        attiny13.bootloader.unlock_bits=0xff
        attiny13.bootloader.lock_bits=0xff
        attiny13.build.core=arduino:core13
        attiny13.build.board=attiny
        attiny13.upload.tool=arduino:arduinoisp
        #########################

        attiny.name=ATtiny45/85
        attiny.bootloader.tool=arduino:avrdude
        attiny.bootloader.unlock_bits=0xff
        attiny.bootloader.lock_bits=0xff
        attiny.build.core=arduino:arduino
        attiny.build.board=attiny
        attiny.upload.tool=arduino:avrdude
        attiny.menu.cpu.attiny45=ATtiny45
        attiny.menu.cpu.attiny45.upload.maximum_size=4096
        attiny.menu.cpu.attiny45.build.mcu=attiny45
        attiny.menu.cpu.attiny45.build.variant=tiny8
        attiny.menu.cpu.attiny85=ATtiny85
        attiny.menu.cpu.attiny85.upload.maximum_size=8192
        attiny.menu.cpu.attiny85.build.mcu=attiny85
        attiny.menu.cpu.attiny85.build.variant=tiny8
        attiny.menu.cpu.attiny44=ATtiny44
        attiny.menu.cpu.attiny44.upload.maximum_size=4096
        attiny.menu.cpu.attiny44.build.mcu=attiny44
        attiny.menu.cpu.attiny44.build.variant=tiny14
        attiny.menu.cpu.attiny84=ATtiny84
        attiny.menu.cpu.attiny84.upload.maximum_size=8192
        attiny.menu.cpu.attiny84.build.mcu=attiny84
        attiny.menu.cpu.attiny84.build.variant=tiny14
        attiny.menu.clock.internal1=1 MHz (internal)
        attiny.menu.clock.internal1.bootloader.low_fuses=0x62
        attiny.menu.clock.internal1.bootloader.high_fuses=0xdf
        attiny.menu.clock.internal1.bootloader.extended_fuses=0xff
        attiny.menu.clock.internal1.build.f_cpu=1000000L
        attiny.menu.clock.internal8=8 MHz (internal)
        attiny.menu.clock.internal8.bootloader.low_fuses=0xe2
        attiny.menu.clock.internal8.bootloader.high_fuses=0xdf
        attiny.menu.clock.internal8.bootloader.extended_fuses=0xff
        attiny.menu.clock.internal8.build.f_cpu=8000000L
        attiny.menu.clock.external8=8 MHz (external)
        attiny.menu.clock.external8.bootloader.low_fuses=0xfe
        attiny.menu.clock.external8.bootloader.high_fuses=0xdf
        attiny.menu.clock.external8.bootloader.extended_fuses=0xff
        attiny.menu.clock.external8.build.f_cpu=8000000L
        attiny.menu.clock.external16=16 MHz (external)
        attiny.menu.clock.external16.bootloader.low_fuses=0xfe
        attiny.menu.clock.external16.bootloader.high_fuses=0xdf
        attiny.menu.clock.external16.bootloader.extended_fuses=0xff
        attiny.menu.clock.external16.build.f_cpu=16000000L
        attiny.menu.clock.external20=20 MHz (external)
        attiny.menu.clock.external20.bootloader.low_fuses=0xfe
        attiny.menu.clock.external20.bootloader.high_fuses=0xdf
        attiny.menu.clock.external20.bootloader.extended_fuses=0xff
        attiny.menu.clock.external20.build.f_cpu=20000000L
        #################################################
        attiny13.menu.cpu.attiny13=ATtiny13
        attiny13.menu.cpu.attiny13.upload.maximum_size=1024
        attiny13.menu.cpu.attiny13.build.mcu=attiny13
        attiny13.menu.cpu.attiny13.build.variant=core13
        attiny13.menu.clock.internal48=4.8MHz (internal)
        attiny13.menu.clock.internal48.bootloader.low_fuses=0x7A
        attiny13.menu.clock.internal48.bootloader.high_fuses=0xff
        attiny13.menu.clock.internal48.build.f_cpu=4800000L
        attiny13.menu.clock.internal96=9.6MHz (internal)
        attiny13.menu.clock.internal96.bootloader.low_fuses=0x79
        attiny13.menu.clock.internal96.bootloader.high_fuses=0xff
        attiny13.menu.clock.internal96.build.f_cpu=9600000L
        ################################################
        attiny.menu.cpu.attiny2313=Attiny2313
        attiny.menu.cpu.attiny2313.upload.maximum_size=2048
        attiny.menu.cpu.attiny2313.build.mcu=attiny2313
        attiny.menu.cpu.attiny2313.build.variant=attiny2313
        attiny.menu.clock.internal8=8 MHz (internal)
        attiny.menu.clock.internal8.bootloader.low_fuses=0xE4
        attiny.menu.clock.internal8.bootloader.high_fuses=0xDF
        attiny.menu.clock.internal8.bootloader.extended_fuses=0xFF
        attiny.menu.clock.internal8.build.f_cpu=8000000L

      2. you still have an attiny13 entry in the same meny as your 45/85 that has extended fuses
        attiny.menu.cpu.attiny13=ATtiny13
        attiny.menu.cpu.attiny13.upload.maximum_size=1024
        attiny.menu.cpu.attiny13.build.mcu=attiny13
        attiny.menu.cpu.attiny13.build.variant=core13
        attiny.menu.clock.internal96=9.6MHz (internal)
        attiny.menu.clock.internal96.bootloader.low_fuses=0x7A
        attiny.menu.clock.internal96.bootloader.high_fuses=0xff
        attiny.menu.clock.internal96.build.f_cpu=9600000L

        Whereas the other attiny 13 entries have their own menu: attiny13.menu

        You also have some entries that dont seem to belong anywhere: (attiny13?
        attiny.menu.clock.internal48=4.8MHz (internal)
        attiny.menu.clock.internal48.bootloader.low_fuses=0x79
        attiny.menu.clock.internal48.bootloader.high_fuses=0xff
        attiny.menu.clock.internal48.build.f_cpu=4800000L

      3. My boardsfile now looks like this (exactle as you filles in above), but i still get the same error:

        ###############################
        menu.cpu=Processor
        menu.clock=Clock
        attiny13.name=Attiny13
        attiny13.bootloader.tool=arduino:avrdude
        attiny13.bootloader.unlock_bits=0xff
        attiny13.bootloader.lock_bits=0xff
        attiny13.build.core=arduino:core13
        attiny13.build.board=attiny
        attiny13.upload.tool=arduino:arduinoisp
        #########################

        attiny.name=ATtiny45/85
        attiny.bootloader.tool=arduino:avrdude
        attiny.bootloader.unlock_bits=0xff
        attiny.bootloader.lock_bits=0xff
        attiny.build.core=arduino:arduino
        attiny.build.board=attiny
        attiny.upload.tool=arduino:avrdude
        attiny.menu.cpu.attiny45=ATtiny45
        attiny.menu.cpu.attiny45.upload.maximum_size=4096
        attiny.menu.cpu.attiny45.build.mcu=attiny45
        attiny.menu.cpu.attiny45.build.variant=tiny8
        attiny.menu.cpu.attiny85=ATtiny85
        attiny.menu.cpu.attiny85.upload.maximum_size=8192
        attiny.menu.cpu.attiny85.build.mcu=attiny85
        attiny.menu.cpu.attiny85.build.variant=tiny8
        attiny.menu.cpu.attiny44=ATtiny44
        attiny.menu.cpu.attiny44.upload.maximum_size=4096
        attiny.menu.cpu.attiny44.build.mcu=attiny44
        attiny.menu.cpu.attiny44.build.variant=tiny14
        attiny.menu.cpu.attiny84=ATtiny84
        attiny.menu.cpu.attiny84.upload.maximum_size=8192
        attiny.menu.cpu.attiny84.build.mcu=attiny84
        attiny.menu.cpu.attiny84.build.variant=tiny14
        attiny.menu.clock.internal1=1 MHz (internal)
        attiny.menu.clock.internal1.bootloader.low_fuses=0x62
        attiny.menu.clock.internal1.bootloader.high_fuses=0xdf
        attiny.menu.clock.internal1.bootloader.extended_fuses=0xff
        attiny.menu.clock.internal1.build.f_cpu=1000000L
        attiny.menu.clock.internal8=8 MHz (internal)
        attiny.menu.clock.internal8.bootloader.low_fuses=0xe2
        attiny.menu.clock.internal8.bootloader.high_fuses=0xdf
        attiny.menu.clock.internal8.bootloader.extended_fuses=0xff
        attiny.menu.clock.internal8.build.f_cpu=8000000L
        attiny.menu.clock.external8=8 MHz (external)
        attiny.menu.clock.external8.bootloader.low_fuses=0xfe
        attiny.menu.clock.external8.bootloader.high_fuses=0xdf
        attiny.menu.clock.external8.bootloader.extended_fuses=0xff
        attiny.menu.clock.external8.build.f_cpu=8000000L
        attiny.menu.clock.external16=16 MHz (external)
        attiny.menu.clock.external16.bootloader.low_fuses=0xfe
        attiny.menu.clock.external16.bootloader.high_fuses=0xdf
        attiny.menu.clock.external16.bootloader.extended_fuses=0xff
        attiny.menu.clock.external16.build.f_cpu=16000000L
        attiny.menu.clock.external20=20 MHz (external)
        attiny.menu.clock.external20.bootloader.low_fuses=0xfe
        attiny.menu.clock.external20.bootloader.high_fuses=0xdf
        attiny.menu.clock.external20.bootloader.extended_fuses=0xff
        attiny.menu.clock.external20.build.f_cpu=20000000L
        #################################################
        attiny13.menu.cpu.attiny13=ATtiny13
        attiny13.menu.cpu.attiny13.upload.maximum_size=1024
        attiny13.menu.cpu.attiny13.build.mcu=attiny13
        attiny13.menu.cpu.attiny13.build.variant=core13
        attiny13.menu.clock.internal48=4.8MHz (internal)
        attiny13.menu.clock.internal48.bootloader.low_fuses=0x7A
        attiny13.menu.clock.internal48.bootloader.high_fuses=0xff
        attiny13.menu.clock.internal48.build.f_cpu=4800000L
        attiny13.menu.clock.internal96=9.6MHz (internal)
        attiny13.menu.clock.internal96.bootloader.low_fuses=0x79
        attiny13.menu.clock.internal96.bootloader.high_fuses=0xff
        attiny13.menu.clock.internal96.build.f_cpu=9600000L
        ################################################
        attiny.menu.cpu.attiny2313=Attiny2313
        attiny.menu.cpu.attiny2313.upload.maximum_size=2048
        attiny.menu.cpu.attiny2313.build.mcu=attiny2313
        attiny.menu.cpu.attiny2313.build.variant=attiny2313
        attiny.menu.clock.internal8=8 MHz (internal)
        attiny.menu.clock.internal8.bootloader.low_fuses=0xE4
        attiny.menu.clock.internal8.bootloader.high_fuses=0xDF
        attiny.menu.clock.internal8.bootloader.extended_fuses=0xFF
        attiny.menu.clock.internal8.build.f_cpu=8000000L

      4. Well Somehow your Attiny13 setting still believes it is an attiny45/85 that needs an extended fuse setting
        I see there is a small difference between your boards text and the one I am using.
        Replace your top section with this:
        menu.cpu=Processor
        menu.clock=Clock

        attiny13.name=Attiny13
        attiny13.bootloader.tool=arduino:avrdude
        attiny13.bootloader.unlock_bits=0xff
        attiny13.bootloader.lock_bits=0xff
        attiny13.build.core=arduino:arduino
        attiny13.build.board=attiny
        attiny13.upload.tool=arduino:arduinoisp

        #########################

        Also, if you have at one time switched from 1.06 to 1.6x IDE, the file folder structure for your cores and boardfiles has changed which may lead to many boards.txt files, so maybe u are working in the wrong one. Also… clear yr cache, just to make sure

      5. Now i get a new error

        ***failed;
        avrdude: verification error, first mismatch at byte 0x0000
        0x3f != 0xff
        avrdude: verification error; content mismatch

        I also can’t compile, with the attiny13 setting:

        Arduino: 1.6.5 (Windows 7), Platine: “ATtiny, ATtiny13, 4.8MHz (internal)”
        C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=attiny13 -DF_CPU=4800000L -DARDUINO=10605 -DARDUINO_attiny -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Users\***\Documents\Arduino\hardware\attiny13\avr\variants\core13 C:\Users\***\AppData\Local\Temp\build5725120670873562421.tmp\sketch_apr19a.cpp -o C:\Users\**\AppData\Local\Temp\build5725120670873562421.tmp\sketch_apr19a.cpp.o

        In file included from sketch_apr19a.ino:1:0:
        C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:249:26: fatal error: pins_arduino.h: No such file or directory
        #include “pins_arduino.h”
        ^
        compilation terminated.

        I deleted the other entries for 45/85, so now it is only attiny13:

        menu.cpu=Processor
        menu.clock=Clock
        attiny.name=ATtiny
        attiny.bootloader.tool=arduino:avrdude
        attiny.bootloader.unlock_bits=0xff
        attiny.bootloader.lock_bits=0xff
        attiny.build.core=arduino:arduino
        attiny.build.board=attiny
        attiny.upload.tool=arduino:avrdude
        ##############################################

        #################################################
        attiny.menu.cpu.attiny13=ATtiny13
        attiny.menu.cpu.attiny13.upload.maximum_size=1024
        attiny.menu.cpu.attiny13.build.mcu=attiny13
        attiny.menu.cpu.attiny13.build.variant=core13
        attiny.menu.clock.internal96=9.6MHz (internal)
        attiny.menu.clock.internal96.bootloader.low_fuses=0x7A
        attiny.menu.clock.internal96.bootloader.high_fuses=0xff
        attiny.menu.clock.internal96.build.f_cpu=9600000L
        ################################################

        attiny.menu.clock.internal48=4.8MHz (internal)
        attiny.menu.clock.internal48.bootloader.low_fuses=0x79
        attiny.menu.clock.internal48.bootloader.high_fuses=0xff
        attiny.menu.clock.internal48.build.f_cpu=4800000L
        ################################################

      6. I start to think maybe you have not installed yr cores right and it cant find the arduino core. In that case just try putting it back to attiny.build.core=core13.
        are you running linux or windows?

      7. thx, now i’m able to upload with programmer without an error, but i’m still not able to “burn” the boatloader (set fuses). So it does not blink every second, it blinks about everty 4-5 secondes (i think becaouse of 4,8 Mhz).

        Error for burning the bootloader is:

        Arduino: 1.6.5 (Windows 7), Platine: “ATtiny, ATtiny13, 4.8MHz (internal)”
        ***failed;
        avrdude: verification error, first mismatch at byte 0x0000
        0x3f != 0xff
        avrdude: verification error; content mismatch

        error burning boatloader (<– translated from german)

      8. Which Arduino are you using for the programming?
        Are you using a capacitor between RESET and ground or a resistor between reset and Vcc to eliminate the auto reset?

      9. the error you described often occurs when the reset is incurred. Another possibility is that the lockbit is set.
        Can you chose ‘verbose error msg’ in your preferences and send me the verbose error msg

      10. the boards works fine with attiny45 and 85, so the reset should be ok, right?

        here is the verbose error msg:

        Arduino: 1.6.5 (Windows 7), Platine: “ATtiny, ATtiny13, 9.6MHz (internal)”

        C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny13 -cstk500v1 -PCOM9 -b19200 -e -Ulock:w:0xff:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:0xff:m -Ulfuse:w:0x7A:m

        avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is “C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf”

        Using Port : COM9

        Using Programmer : stk500v1

        Overriding Baud Rate : 19200

        AVR Part : ATtiny13

        Chip Erase delay : 4000 us

        PAGEL : P00

        BS2 : P00

        RESET disposition : dedicated

        RETRY pulse : SCK

        serial program mode : yes

        parallel program mode : yes

        Timeout : 200

        StabDelay : 100

        CmdexeDelay : 25

        SyncLoops : 32

        ByteDelay : 0

        PollIndex : 3

        PollValue : 0x53

        Memory Detail :

        Block Poll Page Polled

        Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack

        ———– —- —– —– —- —— —— —- —— —– —– ———

        eeprom 65 5 4 0 no 64 4 0 4000 4000 0xff 0xff

        flash 65 6 32 0 yes 1024 32 32 4500 4500 0xff 0xff

        signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

        lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

        calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00

        lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

        hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

        Programmer Type : STK500

        Description : Atmel STK500 Version 1.x firmware

        Hardware Version: 2

        Firmware Version: 1.18

        Topcard : Unknown

        Vtarget : 0.0 V

        Varef : 0.0 V

        Oscillator : Off

        SCK period : 0.1 us

        avrdude: AVR device initialized and ready to accept instructions

        Reading | ################################################## | 100% 0.05s

        avrdude: Device signature = 0x1e9007

        avrdude: erasing chip

        avrdude: reading input file “0xff”

        avrdude: writing lock (1 bytes):

        Writing | ***failed;

        Error burning Bootloader.

        ################################################## | 100% 0.16s

        avrdude: 1 bytes of lock written

        avrdude: verifying lock memory against 0xff:

        avrdude: load data lock data from input file 0xff:

        avrdude: input file 0xff contains 1 bytes

        avrdude: reading on-chip lock data:

        Reading | ################################################## | 100% 0.02s

        avrdude: verifying …

        avrdude: verification error, first mismatch at byte 0x0000

        0x3f != 0xff

        avrdude: verification error; content mismatch

        avrdude done. Thank you.

      11. if it works with 85/45 the wiring is likely to be ok.
        Therefore I suspect a problem with the lockbit. do you have a fresh Attiny13 to try?

        btw…. sometimmes with a lock bit error, the program is still written. See if it is/works

        also try avrdude -c arduinoisp -p attiny13 -P COM9 -b 57600 -u -e -U lock:w:0x3F:m -U
        hfuse:w:0xD8:m -U lfuse:w:0xFF:m -U efuse:w:0xFD:m

        and see what it reports back

        Another possibility is that there somehow still is an error in your boards.txt or avrdude config file.
        You may consider trying codebender.cc for your programming, but you then still need to add attiny13 as a personal board by uploading this text as personal boards:
        attiny13.name=ATtiny13 (internal 9.6 MHz clock)
        attiny13.bootloader.low_fuses=0×7a
        attiny13.bootloader.high_fuses=0xff
        attiny13.upload.maximum_size=1024
        attiny13.build.mcu=attiny13
        attiny13.build.f_cpu=9600000L
        attiny13.build.core=arduino:arduino
        attiny13.build.variant=tiny8

        attiny13at4np.name=ATtiny13 @ 4.8MHz (internal 4.8 MHz clock no prescaler)
        attiny13at4np.bootloader.low_fuses=0x79
        attiny13at4np.bootloader.high_fuses=0xff
        attiny13at4np.upload.maximum_size=1024
        attiny13at4np.build.mcu=attiny13
        attiny13at4np.build.f_cpu=4800000L
        attiny13at4np.build.core=arduino:arduino
        attiny13at4np.variant=tiny8

      12. a fresh attiny13 also gives me the same error:

        ***failed;

        avrdude: verification error, first mismatch at byte 0x0000

        0x3f != 0xff

        avrdude: verification error; content mismatch

        Error burning Bootloader.

      13. then i guess the problem must be in your avrdude.conf or your boards.txt.
        There are several things u can do:
        1 Try the codebender option I explained earlier. If that works you knowfor sure it is not your chip or circuit.
        2 re-install avrdude (easiest i guess is to re-install arduino IDE)

        if 1 works and 2 does not make a difference we have to take a deep look at yr boards.txt again. Apparently sometimes an invisible unicode might have creeped in

  5. My GAWD these authors are in love with the sound of their own “voices”.
    Why not just say “move xxx to ArduionoRoot/boards/blah.blah”
    I don’t need paragraphs saying “navigate here” “create this folder” “enter that folder” create another folder” copy blah-blah-blah.

    1. Well that is maybe not what YOU need but I didnt write this article just for you.
      Apparently you still needed me to tell you how to install the core and out of gratitude you start insulting. Great attitude

  6. Hi !

    Thanks for your tutorial !

    I tried to do as same as your instruction. However, I have an error as same as H4NC above


    ***failed;

    avrdude: verification error, first mismatch at byte 0x0000

    0x3f != 0xff

    avrdude: verification error; content mismatch

    Error burning Bootloader.

    I also tried to re install the IDE (my IDE is 1.6.7) but I still get the same problem

    Could you help me , please?

    Thanks!

    1. Usually this points at a lockbyte problem. Can you select ‘verbose error reporting’ in the preferences. Try again and tell me what the verbose reporting says?
      Is this a factory new chip you are using?

  7. I could not have got ATTiny13 support working under IDE 1.6.11 without this blog post, thank you!

    That said, the github repo has been updated, the .zip you pull does have its own boards.txt now and all the subdirectories in the .zip are proper for use with current IDE 1.6.x (I’m using 1.6.11).

    To install just:
    Download the file from http://sourceforge.net/projects/ard-core13/files/latest/download
    Unzip the downloaded file. KEEP the directory structures.

    Copy the folder attiny13 to { your personal sketchbook folder}/hardware. Create the “hardware” folder if it does not exist already. So your end results would be [your sketchbook folder]/hardware/attiny13

    File > Preferences > Sketchbook location will tell you where your personal sketches are saved.

    There is also another repo with some additional settings for use with the ATtiny13 under Arduino:
    https://github.com/MCUdude/MicroCore#core-settings

    You can have both definitions installed at once, and see which has the features you may need.

    1. thank you for your kind words. indeed, along the way the folder structure has changed a bit since 1.0.6. Thank you for your information

  8. I have problem with uploading on my Attiny13a servo – knob example, although I have succesfully upload the blink sketch. I use 1.6.5 IDE and Arduino Nano as ISP witch 10uF capacitor connecter between GND and RST pin. I get error message like this:

    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp: In function ‘void TIMER1_COMPA_vect()’:
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:82:31: error: ‘TCNT1’ was not declared in this scope
    handle_interrupts(_timer1, &TCNT1, &OCR1A);
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:82:39: error: ‘OCR1A’ was not declared in this scope
    handle_interrupts(_timer1, &TCNT1, &OCR1A);
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp: In function ‘void initISR(timer16_Sequence_t)’:
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:128:5: error: ‘TCCR1A’ was not declared in this scope
    TCCR1A = 0; // normal counting mode
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:129:5: error: ‘TCCR1B’ was not declared in this scope
    TCCR1B = _BV(CS11); // set prescaler of 8
    ^
    In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
    from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\interrupt.h:38,
    from C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:22:
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:129:18: error: ‘CS11’ was not declared in this scope
    TCCR1B = _BV(CS11); // set prescaler of 8
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:130:5: error: ‘TCNT1’ was not declared in this scope
    TCNT1 = 0; // clear the timer count
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:136:5: error: ‘TIFR1’ was not declared in this scope
    TIFR1 |= _BV(OCF1A); // clear any pending interrupts;
    ^
    In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
    from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\interrupt.h:38,
    from C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:22:
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:136:18: error: ‘OCF1A’ was not declared in this scope
    TIFR1 |= _BV(OCF1A); // clear any pending interrupts;
    ^
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:137:5: error: ‘TIMSK1’ was not declared in this scope
    TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
    ^
    In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
    from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\interrupt.h:38,
    from C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:22:
    C:\Program Files (x86)\Arduino\libraries\Servo\src\avr\Servo.cpp:137:20: error: ‘OCIE1A’ was not declared in this scope
    TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
    ^

    1. that is a simple problem and the answer is in your errormesages. Take the last one for instance: it talks about TIMSK1. that is the timer 1 interrupt mask.
      Oops, the attiny13 has no Timer1 🙂
      The knob example uses Servo.h that uses the 16 bit Timer1. The attiny13 only has an 8bit Timer0
      Now if you use the Smeezekitty core you cant even use the Timer0 as that is used for the timing.
      So is it impossible to drive a servo from an attiny13? no not at all. Have a look here: http://www.instructables.com/id/Home-Alone-burglar-deterrent/step3/Home-Alone-The-Software/
      I must admit though that i am not sure anymore if i did that with the smeezekitty core or the p-tiny core

      1. Thanks a lot, so it apears that I have to build my own PWM function for driving servo. Is that what You want me to reply? 🙂 And what about getting the analogRead() , as I remember I had also problems with compile that kind of example…

      2. well you could define it as such, but it is rather simple. I missed yr problem with analogread. Your attiny should be able to just read that. what is exactly the problem with analogread?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s