ATtiny2313 8-bit AVR Microcontroller (original) (raw)

ATtiny2313 is one of the small Flash technology-based microcontrollers based on RISC architecture. An integrated IC with GPIO pins, processor, memory, and other peripherals. A low-power, hi-tech chip introduced by Microchip has a speed of 12 million instructions per second and a data EEPROM of 128 Bytes. It finds its applications from domestic devices to the industrial level to provide digital control to systems.

This tutorial is an introduction to the ATtiny2313 microcontroller. All the features, specifications, pin configuration, operation of GPIO pins, and applications will be discussed here.

ATtiny2313 Introduction

ATtiny2313 AVR microcontroller is an 8-bit microcontroller with an internal oscillator of 4 MHz. It has 20 pins, out of which 18 are GPIO pins, debugWIRE debugging attribute, port, and a USART port for serial interfacing different sensors and electronic components. It also has an inbuilt Watchdog timer to function while in energy-saving mode.

ATtiny2313 Pinout

Following diagram shows the pinout of the ATtiny2313 AVR Microcontroller:

ATtiny2313 pinout diagram 8-bit AVR Microcontroller

ATtiny2313 Pin Configuration

Let us discuss the pinout of the ATtiny 2313 AVR microcontroller. The pin configuration detail in tabular is mentioned below:

Number Pin Name Function
1 Reset/dW/PA2 PortA2/Reset/debug wire pin
2 PD0/RXD Dual I/O PortD0/UART Reception pin
3 PD1/TXD Dual I/O PortD1/UART Transmission pin
4 PA1/XTAL2 PortA1/Oscillator out pin
5 PA0/XTAL1 PortA0/Oscillator in pin
6 CKOUT/XCK/INT0/PD2 Clock Output/USART Clock/Interrupt0/Dual I/O PortD2 pin
7 PD3/INT1 Dual I/O PortD3/Interrupt1 pin
8 PD4/T0 Dual I/O PortD4/Timer0 output pin
9 PD5/OC0B/T1 Dual I/O PortD5/Output compare B output/TImer1 pin
10 GND Ground
11 PD6/ICP Dual I/O PortD6/Input Capture pin
12 PB0/AIN0/PCINT0 Dual I/O PortB0/Analog comparator0/Pin change interrupt0 pin
13 PB1/AIN1/PCINT1 Dual I/O PortB1/Analog comparator1/Pin change interrupt1 pin
14 PB2/OC0A/PCINT2 Dual I/O PortB2/Output compare0 A/Pin change interrupt2 pin
15 PB3/OC1A/PCINT3 Dual I/O PortB3/Output compare1 A/Pin change interrupt3 pin
16 PB4/OC1B/PCINT4 Dual I/O PortB4/Output compare1 B/Pin change interrupt4 pin
17 PB5/MOSI/DI/SDA/PCINT5 Dual I/O PortB5/MOSI/SDA/Pin change interrupt2 pin
18 PB6/MISO/DO/PCINT6 Dual I/O PortB6/MISO/Data output/Pin change interrupt6 pin
19 PB7/UCSK/SCL/PCINT7 Dual I/O PortB7/universal serial interface/SCL/Pin change interrupt7 pin
20 VCC Power supply pin

UART Pins

UART Pin number
RXD PD0
TXD PD1

Externall Interrrupt Pins

Interrupt Number Pin number
INT0 PD3
INT1 PD4

UART Pins

SPI Pins Pin number
MOSI PB5
MISO PB6
SCK PB7

I2C Pins

UART Pin number
SDA PB5
SCL PB7

ATtiny2313 Features and Specifications

Features and Peripherals Availability
Architecture RISC
Pin Count 20
SRAM 128 Bytes
EEPROM/HEF 128 Bytes
Program Memory 2 KiloBytes
CPU speed 20 MHz (max)
Internal Oscillator 4 MHz
Number of Comparators 1
ADC No
DAC No
USB module No
Peripheral Pin select No
PWM channels 4
Resolution of PWM 1024
Number of Timers 2
12C module 1
UART module 1
Cap touch Channels 4
Window watchdog timer (WWDT) No

ATtiny2313 Microcontroller Specifications

ATtiny2313 Peripherals

Some of the detailed features listed as follows:

How to Program ATtiny2313 AVR Microcontroller

Different software and compilers available in the market can be used to program ATtiny2313 AVR microcontrollers.

Support Compilers

We need an IDE, IPE, a suitable compiler, and a programmer/debugger to develop a program. The function of an IDE(Integrated Development Environment) is to provide the environment for programming. The compiler converts the program into readable HEX files. The IPE(Integrated Programming Environment) serves the purpose of burning HEX files in AVR MCUs.

Assembly Language is still functional for programming. Some of the most commonly used compilers are Micro C for AVR, AVR, and ARM Toolchains provided by Atmel’s manufacturers, known as Microchip itself.

Atmel-ICE is an In-circuit programmer/debugger which plays an integral role in programming AVR. It supports In-Circuit-Serial-Programming, operated by a computer, to burn the code into ATtiny2313 AVR using Atmel Studio. Furthermore, hardware like Perfboard, soldering station, Crystal Oscillator, capacitors, AVR IC is required.

ATtiny2313 8-bit AVR Microcontroller minimal circuit

Alternative Microcontrollers

Applications

2D Diagram

ATtiny2313 8-bit AVR Microcontroller comes in three packages, i.e., 20P3, the 20S, and 20M1. The following figure shows the 2d model of ATtiny2313 8-bit AVR Microcontroller(20P3). It shows us the physical dimensions of the components required when a PCB card is designed.

ATtiny2313 2D Diagram

Other AVR Microcontrollers:

AVR Microcontroller Tutorials: