Sunteți pe pagina 1din 2

ATtiny2313

How to use this chip with the Arduino IDE.

The Atmel ATtiny2313 Chip is a compact chip with 16 DIO pins, 2 with Interrupts and 4 with PWM
support.

The core we use to program our projects is available from : http://code.google.com/p/arduino-tiny/

There are currently 2 versions of this core available (for Arduino version 1.0 & 1.5)

This core also works for the ATtiny84 (84/44/24), ATtiny85 (85/45/25) as well as the 2313/4313.

The ATtiny 2313 is a small 20 pin dip chip with 2K of Flash, 128 bytes of SRAM & 128 bytes of
EEPROM, the chip can be run at 1Mhz or 8Mhz without a crystal, and up to 20Mhz with an external
crystal, though this core currently only supports the internal 1Mhz & 8Mhz modes.

The pin mapping of the chip is as follows

// ATMEL ATTINY2313
//
// +-\/-+
// (D 17) PA2 1| |20 VCC
// RX (D 0) PD0 2| |19 PB7 (D 16)
// TX (D 1) PD1 3| |18 PB6 (D 15)
// (D 2) PA1 4| |17 PB5 (D 14)
// (D 3) PA0 5| |16 PB4 (D 13)*
// INT0 (D 4) PD2 6| |15 PB3 (D 12)*
// INT1 (D 5) PD3 7| |14 PB2 (D 11)*
// (D 6) PD4 8| |13 PB1 (D 10)
// *(D 7) PD5 9| |12 PB0 (D 9)
// GND 10| |11 PD6 (D 8)
// +----+
// * indicates PWM port

D 17 is the RESET pin and can be set to an I/O pin by changing the fuses (Please be aware that doing
this disables the chip from being programmed by a standard programmer, and requires a High
Voltage Programmer to reset the fuse bits).
We have found that the easiest way to get this core integrated with your IDE is to copy the Arduino
folder to a new folder & copy the folder called tiny, inside the ZIP file you downloaded from the link
above, to the folder called hardware inside the new Arduino folder you have copied (I called mine
Arduino_Tiny).

Start the IDE from this folder and open the Blink sketch from the examples menu & upload to the
2313 chip. We use an Arduino to do this, connected like this :

Upload the Arduino as ISP sketch to your Arduino and burn the Bootloader (selecting the chip/speed
combination you need from the tools menu).

(You may find that the Arduino will reset when you try to upload your sketch to the ATtiny : Connect
a 10 F capacitor from reset to ground on the Arduino (negative side to ground)
If you are using a Duemilanove use a 120 ohm resistor from reset to Vcc).

While you may have noticed that the chip has a UART (or Rx & Tx lines), these are not currently
supported by core (but may be in the future), you can use the Serial commands to give an output on
pin 3 (D1) This may not give consistent results as you may need to Tune the internal Oscillator
(search for setting OSCCAL on attiny2313 on the Internet)

To upload sketches to the chip, you would need to use a programmer of some type, Our Arduino as
ISP shield (http://proto-pic.co.uk/arduino-as-isp-shield/) is ideal for this as it has both an ISP header
and a ZIF socket (this chip can be programmed in the ZIF socket with an additional jumper wire from
pin 8 to 10 on the socket)

S-ar putea să vă placă și