Skip to main content

ATtiny2313 8-bit AVR Microcontroller

ATtiny2313 is a high-performance but low-power Microchip 8-bit AVR RISC architecture based Microcontroller unit that has 20 pins, out of which 18 pins can be used as I/O pins.

 

ATtiny2313 Pin Configuration

Pin Number

Pin Name

Description

1

RESET/dW/PA2

Port A BIt 2 or RESET used mainly for programming or dW

2

PD0/RXD

Bidirectional I/O Pin of Port D Bit 0 or UART DATA  Receive

3

PD1/TXD

Bidirectional I/O Pin of Port D Bit 1 or UART DATA  Transmit

4

PA1/XTAL2

Port A BIt 1 or Crystal Out

5

PA0/XTAL1

Port A Bit 0 or Crystal In

6

PD2/CKOUT/XCK/INT0

Bidirectional I/O Pin of Port D Bit 2 or External Interrupt 0 or System clock output or USART clock for synchronous transfer

7

PD3/INT1

Bidirectional I/O Pin of Port D Bit 3 or External Interrupt 1

8

PD4/T0

Bidirectional I/O Pin of Port D Bit 4 or Timer 0 Output/counter

9

PD5/OC0B/T1

Bidirectional I/O Pin of Port D Bit 5 or Output compare match Bout or Timer 1 Output / Counter

10

GND

Ground Pin of MCU

11

PD6/ICP

Bidirectional I/O Pin of Port D Bit 6 or Input Capture

12

PB0/AIN0/PCINT0

Bidirectional I/O Pin of Port B Bit 0 or Analog comparator 0 or Pin change Interrupt source

13

PB1/AIN1/PCINT1

Bidirectional I/O Pin of Port B Bit 1 or Analog comparator 1 or Pin change Interrupt source

14

PB2/OC0A/PCIN2

Bidirectional I/O Pin of Port B Bit 2 or Output compare match A out or Pin change Interrupt source

15

PB3/OC1A/PCINT3

Bidirectional I/O Pin of Port B Bit 3 or Output compare match A out or Pin change Interrupt source

16

PB4/OC1B/PCINT4

Bidirectional I/O Pin of Port B Bit 4 or Output compare match Bout or Pin change Interrupt source

17

PB5/MOSI/DI/SDA/PCINT5

Bidirectional I/O Pin of Port B Bit 5 or SPI MOSI, also used in Programming or I2C SDA or Pin change Interrupt source

18

PB6/MISO/DO/PCINT6

Bidirectional I/O Pin of Port B Bit 5 or SPI MISO, also used in Programing or Pin change Interrupt source or three-wire Universal Interface Data output

19

PB7/UCSK/SCL/PCINT7

Bidirectional I/O Pin of Port B Bit 7 or Three-wire mode Universal serial interface or I2C SCL or Pin change Interrupt source or SCK for Programming

20

VCC

Positive Pin of MCU (+5V)

 

Features and Specification of the ATtiny2313 Microcontroller

ATtiny2313 - Simplified Features and Specification

CPU

8-bit AVR

Number of Pins

20

Operating Voltage (V)

1.8-5.5V

Number of I/O pins

18

ADC Module

Nil

Timer Module

8-bit(1), 16-bit(1)

Comparators

1

DAC Module

Nil

Communication Peripherals

1-UART, 2-SPI, 1-I2C

External Oscillator

Yes

Internal Oscillator

8 MHz

Program Memory (KB)

2 KB

CPU Speed (MIPS)

20 MIPS

RAM Bytes

128

Data EEPROM

128 Bytes

 

Note: Complete technical details can be found in the ATtiny2313 Datasheet linked at the bottom of this page.

 

Alternative Product of ATtiny2313

Alternative products for ATtiny2313 microcontroller are listed below-

  1. ATtiny2313A (Exact Alternative with the new release)
  2. ATtiny417
  3. ATtiny28L
  4. ATtiny48
  5. ATmega88PA
  6. ATmega8A
  7. ATmega8515
  8. ATmega8535
  9. ATmega645A
  10. ATmega6490

 

Introduction to ATtiny2313

ATtiny2313 is a high-performance but low-power Microchip 8-bit AVR RISC architecture based Microcontroller unit that has 20 pins, out of which 18 pins can be used as I/O pins.

 

It has Powerful instruction architecture that provides a processing speed of 1 MIPS per MHz while balancing power consumption at the same time processing high-speed performance. The speed could reach up to 20 MIPS if 20 Mhz max frequency is used. ATtiny2313 also comes with the debugWIRE On-Chip debugging feature, In-system Programmable SPI Port, Low-Power Idle, Power-down, and Standby Modes. It also uses a programmable brownout detection circuit.

 

It has a wide operating voltage range, from 1.8V to 5.5V. Thus, it can be used in 1.8V, 3.3V, or 5.0V logic level operations. However, 0-4 Mhz operation is supported by the 1.8V input voltage for ATtiny2313V. For frequency up to 10 Mhz, the minimum voltage is required 2.7V for ATtiny2313, and for 20 Mhz operations, the minimum voltage is required 4.5V-5.5V.

 

The below image is showing the detailed pin diagram of the ATtiny2313.

ATtiny2313 Pin Diagram

 

Detailed Features of ATtiny2313

ATtiny2313 –Detailed Features

CPU

8-Bit AVR RISC

Architecture

8

Program Memory Size (Kbytes)

2

RAM (bytes)

128

EEPROM/HEF

128

Pin Count

20

Max. CPU Speed (MHz)

20

Peripheral Pin Select (PPS)

No

Internal Oscillator

4-Mhz

No. Of comparators

1

No. Of  Operational Amplifier

0

No. Of ADC channels

0

Max ADC Resolution (bits)

-

ADC with Computation

0

Number of DAC Converter

0

Max DAC resolution

-

Internal Voltage Reference

No

Zero Cross Detect

No

No. Of 8-bit timers

1

No. Of 16-bit Timers

1

Signal Measurement Timer

0

Hardware Limit Timer

0

No. Of PWM outputs

4

Max PWM resolution

1024

Angular Timer

0

Math Accelerator

No

No. Of  UART module

1

No. Of SPI Module

2

No. Of I2C module

1

No. Of USB Module

0

Windowed Watchdog Timer (WWDT)

No

CRC/Scan

No

Numerically Controlled Oscillator

No

Cap. Touch Channels

4

Segment LCD

0

Minimum Operating Temperature (*C)

-40

Maximum Operating Temperature (*C)

85

Minimum Operating Voltage (V)

1.8 / (2.7 up to 10 Mhz) / (4.5 up to 20 Mhz)

Maximum Operating Voltage (V)

5.5

High Voltage Capable

No

 

Programming AVR Microcontroller

PIC microcontrollers can be programmed with different software that is available in the market. There are people who still use Assembly language to program AVR MCUs. The below details is for the most advanced and common software and compiler that has been developed by Atmel (now Microchip) itself.

 

In order to program the AVR microcontroller, we will need an IDE (Integrated Development Environment), where the programming takes place. A compiler, where our program gets converted into MCU readable form called HEX files.

 

IDE: Atmel Studio 7

Compiler: AVR and ARM Toolchains

 

Microchip has given all these two software for free. They can be downloaded directly from their official page. I have also provided the link for your convenience. Once downloaded, install them on your computer. If you have any problem doing so, you can post them in the comment below.

 

To dump or upload our code into AVR, we will need a device called ATAtmel-ICE. The ATATmel - ICE programmer/debugger is a simple, in-circuit debugger that is controlled by a PC running Atmel Studio software on a Windows platform. The ATAtmel-ICE programmer/debugger is an integral part of the development engineer's tool suite. The basic ATtiny2313 programming circuit is shown below.

ATtiny2313 Programming Circuit

Other than this official programmer, users also use USB ASP AVR Programming Device for low-cost programming solutions.

 

In addition to this, we will also need other hardware like a Perf board or breadboard, Soldering station, AVR ICs, Crystal oscillators, capacitors, etc.

 

Components Associated with AVR

USB ASP AVR Programmer, AVR Development Board, Crystal Oscillators, Capacitors, 12V Adapter, 7805 Voltage Regulator.

 

2D Model

The dimensions of the ATtiny2313 are shown below-

ATtiny2313 Dimensions

Component Datasheet

Related Post



Join 20K+subscribers

We will never spam you.

* indicates required

Be a part of our ever growing community.