Instructables
Picture of Installing Attiny13 core files
In an instructable "Make an Attiny13 based IR proximity sensor for $2.42" by Dustin Andrews refers to having to install the Attiny13 core files.


Unfortunately the core files that are linked to do not contain the boards.txt file that will let the Attiny 13 show up as choice under 'Tools-boards' in the IDE. If you are a novice at installing core files this may seem daunting, but since I just did it, I thought I'd just share that knowledge with you.

Do the following:
-Download the Attiny cores from: http://sourceforge.net/projects/ard-core13/
-Go to your sketches folder
-most likely there is a folder called 'hardware' if not, create that.
-open the hardware folder
-create a folder called 'attiny13'
-open that folder
-create a folder called cores
-open that folder
-create a new folder called 'core13'
-so now you have the structure /hardware/attiny13/cores/core13
-open that deepest folder and unzip the attiny core files to that folder
-go back to your /hardware/attiny13 folder
-create a text file called 'boards.txt'
open that file.
paste the following text in that file:

###########################################################################
attiny13int.name=Attiny13 @ 128 KHz (internal watchdog oscillator)
attiny13int.upload.using=arduino:arduinoisp
attiny13int.upload.maximum_size=1024
attiny13int.upload.speed=250 # important for not losing connection to a slow processor
attiny13int.bootloader.low_fuses=0x7B
attiny13int.bootloader.high_fuses=0xFF
attiny13int.bootloader.unlock_bits=0x3F
attiny13int.bootloader.lock_bits=0x3F
attiny13int.build.mcu=attiny13
attiny13int.build.f_cpu=128000
attiny13int.build.core=core13

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

attiny13at4.name=ATtiny13 @ 4.8MHz (internal 4.8 MHz clock)
attiny13at4.upload.using=arduino:arduinoisp
attiny13at4.bootloader.low_fuses=0x69
attiny13at4.bootloader.high_fuses=0xff
attiny13at4.upload.maximum_size=1024
attiny13at4.build.mcu=attiny13
attiny13at4.build.f_cpu=600000
attiny13at4.build.core=core13
###############################################################

attiny13.name=ATtiny13 @ 9.6MHz (interne 9.6 MHz clock)
attiny13.upload.using=arduino:arduinoisp
attiny13.bootloader.low_fuses=0x7a
attiny13.bootloader.high_fuses=0xff
attiny13.upload.maximum_size=1024
attiny13.build.mcu=attiny13
attiny13.build.f_cpu=1200000
attiny13.build.core=core13
###############################################################

I got this 'boards.txt' file from here, but had to adapt it a little as that file 'sneekishly'  suddenly changes the programmer in its last definition and also I had big trouble getting more than 2 boards to show up, until I realised that 2 of the board definitions carried the same name, so I had to change that as well.

So, just as a final check that you have done everything right:
Go to your hardware folderYou should see a folder there called attiny13
Open that folder
It should have 2 entries: a folder called 'cores' and a text file called 'boards.txt'
open the folder 'cores'
That should have one entry: a folder called 'core13'
open 'core13'. There you should find 13 files with 'h', 'c' and 'cpp' extensions.

To make it easy I made a zip file that should unpack with the right directory structure. Unzip it in the 'hardware' folder
Nice work!

Did you also have to change the wiring.c like it says here? I think I ended up needing to do that to get the blink program to work at the right speed. It may not matter for the IR sensor.
diy_bloke (author)  dustinandrews3 months ago

Blink on 1.05 works

diy_bloke (author)  dustinandrews2 years ago
No I did not do that. I did not try the blink program, just quickly a few other statements and that worked. I did not really set out to validate the core, just to instruct how to install the available one.
A quick test showed me it was working
diy_bloke (author)  diy_bloke2 years ago
Let me add that I am not sure if the link you gave above is the same core and I used the 22 IDE, not the 1.0
diy_bloke (author)  diy_bloke2 years ago
I checked a bit further and it seems that the article about changing the wiring.c that you provide th elink for, deals with a different core. That wiring.c has references to the 44 and 84, whereas the one I describe above (that is coming from yr ibble :-) ) does not have these. Also the header file 'iotn13.h' is not present in the core (from 'Smeezekitty' you and I link to, suggesting the change in wiring.c involves a different core.
ihart3 months ago

Thanks for writing this up. I know it's been a while. I am running Arduino 1.5.4 and I am having issues with getting the Attiny13 to compile.

First, the only place I can get the Attiny13's to show up in the Arduino IDE is when I put the folder here:

C:\Program Files\Arduino\hardware\arduino

Second, when I chose any of the 3 Attiny13's offered in the Arduino IDE and compile my sample sketch I get this error:
processing.app.debug.RunnerException
at processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:554)
at processing.app.debug.Compiler.compileFiles(Compiler.java:246)
at processing.app.debug.Compiler.compileSketch(Compiler.java:592)
at processing.app.debug.Compiler.compile(Compiler.java:96)
at processing.app.Sketch.build(Sketch.java:1569)
at processing.app.Sketch.build(Sketch.java:1548)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1915)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:99)
at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:91)
at processing.app.helpers.StringReplacer.formatAndSplit(StringReplacer.java:39)
at processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:552)
... 7 more

Note: If I compile my sample sketch for an UNO, it looks good.

Any ideas?

gussmith5 months ago

Does not work for me in 1.5.6-r2

diy_bloke (author)  gussmith5 months ago

sorry about that. I have no experience with 1.5.6-r2. It is a bèta release. maybe that is the problem

gussmith gussmith5 months ago

I installed 1.05 and there it works.

Idrispo5 months ago

i made this!!!...but not yet try the led blinking...

diy_bloke (author)  Idrispo5 months ago

Great! :-)

legit, thanks DIY_Bloke
diy_bloke (author)  danm_daniel1 year ago
my pleasure
WWC2 years ago
Very good!

I was actually trying to install the 13 files and not working. Then i came across your ible on it and you saved the day. Works perfectly.

Thanks

W
diy_bloke (author)  WWC2 years ago
My pleasure