So, the ATTiny85 is good and everything; it's small, it's easy to program, but it only has five usable pins. Plus, it's memory isn't too great. Sometimes, you need more like 17 pins. That is when the ATTiny2313 comes in handy. It is a twenty-pin chip, has UART (your basic serial connection), I2C, SPI... a lot more than the Tiny85 (Which only has USI, or Universal Serial Interface). In this post I'm going to show how to install the cores, which is really the same as installing the ATTiny core, but there are a few hints.
Getting the Cores
Just as with the ATTiny85, we first have to get the cores. The cores are the files that the Arduino program uses to determine how to program the chip, how big the program can be, etc. I used the one from this page (this is the actual download link). Download that file and unzip it if it isn't already unzipped. If you open it up, you'll see something like this:
main.cpp should look like this. |
#include "WProgram.h"
The Arduino IDE will include this Arduino.h in the sketch's program, and this edit makes Arduino.h include all the old WStuffs.
Now, close main.cpp and navigate to your Arduino sketchbook. How to find this is in the ATTiny85 core installation post (Not to overstate, but if you haven't read the '85 tutorial, you should. It'll make much more sense). Open /hardware/attiny45_85/boards.txt. Here's a helpful file path:
This will have a lot of definitions for the '85 and '45 if you have installed them. Just add this at the top or the bottom.
attiny2313.name=ATtiny2313
attiny2313.upload.using= arduino:arduinoisp
attiny2313.upload.maximum_ size=2048
attiny2313.build.mcu= attiny2313
attiny2313.build.f_cpu= 1000000L
attiny2313.build.core= attiny2313
This bit of text tells the Arduino program about the chip we're using: the name, the upload protocol, the memory size, the speed, and some other things.
That's about it for configuration. Take a look at this page for how to get the program to the chip. The process is the same: connect the SPI lines of each microcontroller and attempt and upload! Leave a comment with any questions!
Now, close main.cpp and navigate to your Arduino sketchbook. How to find this is in the ATTiny85 core installation post (Not to overstate, but if you haven't read the '85 tutorial, you should. It'll make much more sense). Open /hardware/attiny45_85/boards.txt. Here's a helpful file path:
This will have a lot of definitions for the '85 and '45 if you have installed them. Just add this at the top or the bottom.
attiny2313.name=ATtiny2313
attiny2313.upload.using=
attiny2313.upload.maximum_
attiny2313.build.mcu=
attiny2313.build.f_cpu=
attiny2313.build.core=
This bit of text tells the Arduino program about the chip we're using: the name, the upload protocol, the memory size, the speed, and some other things.
That's about it for configuration. Take a look at this page for how to get the program to the chip. The process is the same: connect the SPI lines of each microcontroller and attempt and upload! Leave a comment with any questions!
Think someone might overlooked...
ReplyDeleteThe entire attiny2313 folder in the zip file should be put into the following folder for it to work.
/hardware/attiny45_85/cores
Hmmm... I believe it is. Look at the last picture. It shows the file structure that works, and I think it already is how you described it.
DeleteIt would be great if you posted the pinout to program the attiny2313!
ReplyDeleteHi
ReplyDeleteI am still getting an error. This a link to the error screen shot.
Would you be able to give me some pointers on what i may be doing incorrectly.
Thanks
W
http://imageshack.us/a/img204/2106/screenshot1xe.png
Please post your WProgram.h here.
Deletei'm a newbie at arduino, so, the 2313 doesn't have the arduino bootloaader right? you just use arduino tu program it? and the code in the ide, can I code as if I was doing it for arduino?
ReplyDeletestill have the same problem with philiwayne. It seems it doesn't work :P Please help!
ReplyDelete