Microchip Technology

ATTINY4313-SU - 8-Bit AVR 20MHz 4KB Flash MCU | Microchip

N.º de pieza: ATTINY4313-SU ✓ Activo
1.8 V to 5.5 V Vdss 20-pin SOIC Package 20 MHz Speed 4 KB (2K x 16 words) Memory
MOQ: 1 |

ATTINY4313-SU Descripción general

The Microchip ATTINY4313-SU is an 8-bit AVR RISC-based microcontroller with 4 KB of in-system programmable Flash, 256 bytes of SRAM, 256 bytes of EEPROM, and a 20 MHz maximum clock, housed in a 20-pin SOIC package. It operates from 1.8 V to 5.5 V and provides 18 general-purpose I/O lines for compact embedded-control designs.

An 8-bit AVR microcontroller is a compact RISC processor that combines Flash program memory, SRAM, EEPROM data storage, timers, serial interfaces, and interrupt logic on one integrated circuit. The TinyAVR family sits below larger ATmega devices in pin count and memory capacity, while retaining the AVR instruction set, on-chip debugging support, and a mature C and assembly development ecosystem. The ATTINY4313 targets cost-sensitive products requiring moderate processing capability and several communications interfaces.

Key device features include 20 MHz operation, 4 KB Flash organized as 2K x 16 words, 256 bytes of SRAM, 256 bytes of EEPROM, 18 I/O pins, and operation down to 1.8 V. Integrated peripherals include an 8-bit timer/counter with compare modes, an 8-bit timer/counter with PWM and an external clock input, a serial USART, SPI, Universal Serial Interface support, and a single-wire interface for on-chip debugging.

The ATTINY4313 architecture provides 32 general-purpose working registers and an 8-bit data path optimized for fast interrupt response and low-power control. Program memory can be written through serial programming, while the single-wire debug interface supports efficient in-circuit development. The 1.8 V minimum operating voltage supports both 1.8 V battery-powered systems and conventional 3.3 V or 5 V industrial and consumer equipment.

Typical applications include compact sensor controllers, building-automation endpoints, battery-powered instruments, motor and relay controllers, LED-control modules, programmable logic controllers, and USB-to-serial interface designs. Its 18 available I/O lines make it particularly suitable when a design needs several digital inputs, actuator outputs, and serial connectivity without moving to a larger microcontroller package.

Designers should follow the pin-description and decoupling guidance in the manufacturer data sheet, provide a stable supply close to the supply pins, and verify timing margins when the internal oscillator drives communication interfaces. The 20-pin SOIC footprint also makes the ATTINY4313-SU a practical upgrade path from compatible ATtiny2313 and ATtiny2313A designs that require more Flash memory.

This page consolidates the Microchip device specifications, interface details, migration information, and application guidance with a parameter-by-parameter comparison against compatible AVR alternatives. It is intended to help engineers confirm the electrical, memory, package, and tooling requirements before embedding the device in a new PCB.

Alternativas directas para ATTINY4313-SU — mismo encapsulado, compatible pin a pin. Se excluyen las piezas de otro encapsulado que requieren retrabajo de la PCB.

Variantes de esta serie

Modelos de la misma serie compatibles directamente con ATTINY4313-SU (mismo factor de forma y huella) — difiere en EEPROM, General-Purpose I/O Lines, General-Purpose Working Registers, Package, RoHS Status.

Microchip Technology
EEPROM: 128 B
General-Purpose I/O Lines: 18
General-Purpose Working Registers: 32
Comparar con ATTINY4313-SU →

ATTINY4313-SUR

✅ Sustitución directa
📦 20-pin SOIC
Same ATtiny4313 device, 4 KB Flash, 256 bytes SRAM, 256 bytes EEPROM, and 20 MHz rating; order code differs only in reeled procurement format

📋 Alternativa de referencia (no en el catálogo)

ATTINY2313A-SU

✅ Sustitución directa
Microchip Technology
📦 20-pin SOIC
AVR 8-bit RISC · 20 MHz · 2 KB (1K x 16) · 128 B · 128 B · 18 · 32 · 1.8 V to 5.5 V

Consulte el precio

Ver hoja de datos →

ATTINY2313-SU

✅ Sustitución directa
📦 20-pin SOIC
Code- and pin-compatible per Microchip AVR538, but has 2 KB Flash, 128 bytes EEPROM, and 128 bytes SRAM versus 4 KB, 256 bytes, and 256 bytes

📋 Alternativa de referencia (no en el catálogo)

ATTINY4313-SU Valores máximos y características eléctricas

Product Type 8-bit RISC-based Flash Microcontroller
Architecture AVR 8-bit RISC
Series TinyAVR
Maximum Clock Speed 20 MHz
Flash Memory 4 KB (2K x 16 words)
SRAM 256 bytes
EEPROM 256 bytes
General-Purpose I/O Lines 18 lines
General-Purpose Working Registers 32 registers
Operating Voltage Range 1.8 V to 5.5 V
Timer/Counters 2
Serial Interfaces USART, SPI, Universal Serial Interface, single-wire debug
Program Memory Type In-System Programmable Flash
Encapsulado 20-pin SOIC
Tipo de montaje Surface Mount
Estado RoHS RoHS

Configuración de pines de ATTINY4313-SU

SOIC-20 Package Pinout Diagram SOIC-20W 20-pin, 7.5x12.8mm, P1.27mm, JEDEC MS-013. 1 20 2 19 3 18 4 17 5 16 6 15 7 14 8 13 9 12 10 11 SOIC-20
Pin 1 PB4 — General-purpose I/O port B pin 4
Pin 2 PB3 — General-purpose I/O port B pin 3
Pin 3 PB2 — General-purpose I/O port B pin 2
Pin 4 PB1 — General-purpose I/O port B pin 1
Pin 5 PB0 — General-purpose I/O port B pin 0
Pin 6 PA7 — General-purpose I/O port A pin 7
Pin 7 PA6 — General-purpose I/O port A pin 6
Pin 8 PA5 — General-purpose I/O port A pin 5
Pin 9 PA4 — General-purpose I/O port A pin 4
Pin 10 PA3 — General-purpose I/O port A pin 3
Pin 11 PA2 — General-purpose I/O port A pin 2
Pin 12 PA1 — General-purpose I/O port A pin 1
Pin 13 PA0 — General-purpose I/O port A pin 0
Pin 14 GND — Ground supply connection
Pin 15 PC5 — General-purpose I/O port C pin 5
Pin 16 PC4 — General-purpose I/O port C pin 4
Pin 17 PC3 — General-purpose I/O port C pin 3
Pin 18 PC2 — General-purpose I/O port C pin 2
Pin 19 PC1 — General-purpose I/O port C pin 1
Pin 20 VCC — Positive supply voltage connection

Aplicaciones típicas

ATTINY4313-SU es adecuado para 6 aplicacións: Battery-Powered Sensor Controller, Building Automation Endpoint, Compact Motor and Relay Controller, LED Lighting Controller, Programmable Logic Controller, USB-to-Serial Interface Module.

🔋

Battery-Powered Sensor Controller

The ATTINY4313-SU fits compact battery-powered monitoring equipment because it operates from 1.8 V to 5.5 V and combines 4 KB of Flash with 256 bytes of SRAM. Its 18 I/O lines can accommodate a digital sensor, status indicator, push button, and low-current actuator control. A typical design powers the device from a regulated 1.8 V or 3.3 V rail, keeps the MCU in a sleep state between measurements, and wakes it through an interrupt. The 20 MHz clock provides useful margin for sensor conditioning and serial data handling while the single-wire debug interface assists low-power firmware development.

🏠

Building Automation Endpoint

The ATTINY4313-SU is suitable for building-automation endpoints that monitor switches or environmental inputs and control relays or indicator lights. Its 18 general-purpose I/O lines reduce the need for an I/O expander, while the USART and SPI peripherals support communication with a room controller or sensor board. At 1.8 V minimum operation, the device can integrate with modern low-energy digital sensor ecosystems. Firmware can debounce inputs, maintain event counters in EEPROM, and report status through the serial interface while the timer/counter blocks handle periodic sampling.

⚙️

Compact Motor and Relay Controller

The ATTINY4313-SU can implement a compact motor or relay controller where deterministic timing, multiple control outputs, and serial configuration are required. Its two timer/counter blocks provide the foundations for pulse-width modulation, input capture, and timing tasks, while 18 I/O lines allow connection to limit switches, Hall sensors, and driver logic. The MCU operates from 1.8 V to 5.5 V to accommodate different gate-driver or relay-interface supply levels. Designers should use transistor drive stages rather than driving inductive loads directly from port pins and include flyback protection on relay and motor paths.

💡

LED Lighting Controller

The ATTINY4313-SU supports small LED lighting and signage modules that require programmable patterns, button control, and serial setup. The 4 KB of Flash is sufficient for compact animation tables and state-machine firmware, while 18 I/O lines can drive indicator LEDs, connect to a rotary encoder, or operate digital LED drivers through serial commands. The 20 MHz maximum clock provides sufficient timing margin for software-generated modulation and serial configuration. For multichannel lighting designs, use PWM-capable timer outputs and current-limiting resistors or constant-current driver stages rather than driving LED current directly from the MCU.

🏭

Programmable Logic Controller

The ATTINY4313-SU can serve as the controller in a small PLC-like module with discrete inputs, relay outputs, and an operator interface. Eighteen I/O lines provide useful channel density for a compact board, and the on-chip timers support input filtering and timed output sequences. Its 1.8 V to 5.5 V operating range simplifies interface design across industrial 24 V systems when appropriate regulation and isolation are used. Store configuration and event counters in the 256-byte EEPROM, use the USART for a service connection, and implement watchdog and brownout behavior according to the manufacturer configuration guidance.

🌐

USB-to-Serial Interface Module

The ATTINY4313-SU is appropriate for a compact USB-to-serial adapter because it includes a USART, SPI interface, and the program Flash needed for USB firmware and protocol handling. Its 18 I/O lines allow connection to status LEDs, configuration inputs, and secondary serial channels. The 20-pin SOIC package keeps the converter small and is compatible with the documented ATtiny2313 and ATtiny2313A migration path. Use Microchip's USB implementation guidance and a USB-capable programming environment, and validate enumeration timing and host compatibility across the operating systems targeted by the product.

What are the key specifications of ATTINY4313-SU that engineers should know?
The ATTINY4313-SU is an 8-bit AVR microcontroller with a 20 MHz maximum clock, 4 KB of Flash memory, 256 bytes of SRAM, 256 bytes of EEPROM, and 18 general-purpose I/O lines. It operates from 1.8 V to 5.5 V and is packaged in a 20-pin SOIC. According to the Microchip ATtiny2313A/4313 data sheet, it also includes two timer/counters, a USART, SPI, Universal Serial Interface capability, and a single-wire debugging interface.
Where can I download the ATTINY4313-SU datasheet PDF?
The official ATTINY4313-SU data sheet is available from Microchip as document 8246S at https://ww1.microchip.com/downloads/en/DeviceDoc/8246S.pdf. It covers the ATtiny2313A/4313 family, including electrical characteristics, pin descriptions, memory organization, timers, serial interfaces, and application information. Use the manufacturer document for final pin assignments, timing limits, and power-consumption values before releasing a PCB layout.
Where can I find the ATTINY4313-SU pinout?
The ATTINY4313-SU uses a 20-pin SOIC package, and its complete pin arrangement is shown in the pin-description table of Microchip document 8246S. The device provides port pins for PA0 through PA7 and PB0 through PB4, along with PC0 through PC4 for a total of 18 general-purpose I/O lines. Pin 20 is VCC and pin 14 is GND in the standard 20-pin SOIC arrangement.
What is the ATTINY4313-SU operating voltage range?
The ATTINY4313-SU operates from 1.8 V to 5.5 V. This range supports energy-efficient 1.8 V systems as well as 3.3 V and 5 V equipment. The manufacturer lists the device as an 8-bit AVR microcontroller with 20 MHz operation, 4 KB Flash, and 256 bytes of SRAM. Confirm the exact electrical limits for the selected temperature grade in document 8246S before designing the power tree.
Can ATTINY4313-SU replace ATTINY2313A-SU on an existing PCB?
Yes, the ATTINY4313-SU is a code- and pin-compatible upgrade for ATTINY2313A designs. Microchip application note AVR538 states that ATtiny4313 is code and pin compatible with ATtiny2313 and ATtiny2313A. The principal benefit is the move from 2 KB to 4 KB of Flash while retaining the 20-pin footprint. Recheck the application for the larger memory requirement and verify that the existing firmware and peripherals remain within the intended operating conditions.
What is the best drop-in replacement for ATTINY4313-SU?
The closest documented drop-in replacement is the ATTINY4313-SUR, which uses the same ATtiny4313 device and 20-pin SOIC footprint but is supplied on tape and reel for automated production. For a functional upgrade with more program memory, ATTINY2313A-SU remains code- and pin-compatible in the reverse direction but has only 2 KB of Flash. Microchip application note AVR538 documents the ATtiny2313, ATtiny2313A, and ATtiny4313 compatibility relationship.
What is the difference between ATTINY4313-SU and ATTINY4313-SUR?
Both parts use the same Microchip ATtiny4313 microcontroller in a 20-pin SOIC package, with 4 KB Flash, 256 bytes of SRAM, 256 bytes of EEPROM, and 20 MHz maximum operation. The practical difference is the order code associated with the shipping format and commercial program. Use ATTINY4313-SU for standard tube-based procurement and ATTINY4313-SUR for reel-fed assembly, while checking the manufacturer ordering information for the approved purchasing configuration.
When should I choose ATTINY4313-SU over ATTINY2313A-SU?
Choose ATTINY4313-SU when firmware requires more than the 2 KB Flash available in the ATTINY2313A-SU. The ATTINY4313 retains code and pin compatibility while doubling program memory to 4 KB. Both devices provide comparable 20-pin AVR integration and peripheral resources, so the decision usually comes down to code capacity, procurement configuration, and qualification. Review the migration notes in AVR538 and recompile the firmware for the target device.
Is ATTINY4313-SU suitable for a battery-powered sensor controller?
Yes, the ATTINY4313-SU is suitable for battery-powered sensor controllers because it supports operation down to 1.8 V and combines 4 KB of Flash with 256 bytes of SRAM in a compact 20-pin SOIC package. Its 18 I/O lines leave room for sensors, indicators, and actuator control. The exact battery life depends on the selected sensor, duty cycle, regulator efficiency, and peripheral configuration, so evaluate those conditions with the manufacturer power-consumption data.
How do I program an ATTINY4313-SU?
The ATTINY4313-SU can be programmed through its serial programming interface, and the integrated single-wire interface supports on-chip debugging. A programming toolchain commonly provides assembler, C compiler, debugger, and simulator support for the AVR architecture. Connect the programmer to the device in-circuit, select the correct target signature, verify the operating voltage, and follow the programming and fuse guidance in Microchip document 8246S.
What peripherals are integrated into the ATTINY4313-SU?
The ATTINY4313-SU integrates two flexible 8-bit timer/counters with compare and PWM functions, a serial-programmable USART, SPI, Universal Serial Interface support, and internal and external interrupt capability. It also provides 32 working registers and 18 general-purpose I/O lines. According to Microchip document 8246S, these peripherals allow the device to handle timing, serial communication, and control functions without adding external interface chips.
Where can I buy ATTINY4313-SU online?
Use the Request a Quote form on this page to request ATTINY4313-SU pricing, current inventory, and delivery information for your required quantity. The component is also indexed by authorized distributors and catalog sources, but XAIPART handles quotation requests directly through the page form. Include the target quantity, date code requirement, and whether you need tube or tape-and-reel presentation before releasing a purchase order.
What is the price and lead time of ATTINY4313-SU?
Current ATTINY4313-SU pricing, quantity breaks, stock status, and lead time should be obtained through the Request a Quote form on this page. Availability can vary with order quantity, procurement format, and manufacturer inventory. Provide the required delivery quantity and whether you require tube or tape-and-reel packaging so the quotation can be matched to your assembly schedule and bill of materials.
Is ATTINY4313-SU currently in stock?
ATTINY4313-SU is shown as an in-stock component in current distributor catalog listings, but the usable quantity changes with market activity. Use the Request a Quote form on this page for a stock confirmation tied to your requested quantity and procurement format. For production planning, also confirm the manufacturer lifecycle status, date-code policy, and whether your BOM requires the tube or tape-and-reel order code.
What can replace ATTINY4313-SU in an existing design?
The safest replacement is the ATTINY4313-SUR because it uses the same ATtiny4313 silicon and 20-pin SOIC footprint but provides a reeled procurement format. The ATTINY2313A-SU is also code- and pin-compatible according to AVR538, although it provides only 2 KB of Flash and therefore requires firmware to fit within the smaller memory. Neither substitution changes the USB or serial interface arrangement, but both require procurement and qualification review before release.

Datos de referencia de ingeniería para ATTINY4313-SU — comparación, orientación de diseño e información de cumplimiento.

Guía de selección

Choose the ATTINY4313-SU when a design needs 4 KB of Flash, 256 bytes of SRAM and EEPROM, 18 I/O lines, and operation from 1.8 V to 5.5 V in a 20-pin SOIC footprint. It is the standard tube-format choice for prototype and moderate production builds. Select ATTINY4313-SUR when the same device and electrical configuration are required for reel-fed automated assembly. ATTINY2313A-SU is appropriate when code and pin compatibility with the ATtiny4313 is needed but the firmware fits within 2 KB of Flash. Use the original ATTINY2313-SU only for legacy or memory-constrained designs because its SRAM and EEPROM are each 128 bytes. No cross-brand drop-in alternative was identified in the available Microchip compatibility documentation; validate any third-party substitution for instruction set, peripheral mapping, fuse behavior, and toolchain support.

Comparación con alternativas

Parámetro Este producto ATTINY4313-SUR ATTINY2313A-SU ATTINY2313-SU
Brand Microchip Technology Microchip Technology Microchip Technology Microchip Technology
Package 20-pin SOIC 20-pin SOIC 20-pin SOIC 20-pin SOIC
Architecture 8-bit AVR RISC 8-bit AVR RISC 8-bit AVR RISC 8-bit AVR RISC
Maximum Clock Speed 20 MHz 20 MHz 20 MHz 20 MHz
Flash Memory 4 KB 4 KB 2 KB 2 KB
SRAM 256 bytes 256 bytes 256 bytes 128 bytes
EEPROM 256 bytes 256 bytes 256 bytes 128 bytes
General-Purpose I/O Lines 18 18 18 18
Operating Voltage Range 1.8 V to 5.5 V 1.8 V to 5.5 V 1.8 V to 5.5 V 1.8 V to 5.5 V
Pin and Code Compatibility ATtiny4313 reference device Same device and footprint Code- and pin-compatible per AVR538 Code- and pin-compatible per AVR538

Diferenciadores clave

  • Twice the program memory of ATtiny2313-class devices (frente a ATTINY2313A-SU)
  • Larger SRAM and EEPROM allocation (frente a ATTINY2313-SU)
  • Identical controller with automated-production reel option (frente a ATTINY4313-SUR)

Notas de diseño

Place the supply bypass capacitor close to pins 20 and 14 and follow the recommended network in Microchip document 8246S. Route programming and debug signals away from noisy switching nodes, particularly relay or motor drive traces. For a new design, preserve the 20-pin SOIC footprint and test-point access for ISP programming so firmware updates and recovery do not require rework.

Do not treat the ATTINY2313 and ATTINY2313A as exact functional equivalents for firmware larger than 2 KB. Microchip AVR538 confirms code and pin compatibility, but the ATTINY4313 provides 4 KB of Flash, 256 bytes of SRAM, and 256 bytes of EEPROM, while the original ATtiny2313 provides 2 KB, 128 bytes, and 128 bytes respectively. Check code size, RAM allocation, EEPROM usage, and fuse settings before substitution.

Keep analog and communication interfaces away from the switching node of any external power converter, and use a controlled ground return for serial signals. The single-wire debug interface is useful during development, but its signal routing should avoid long unprotected traces. For designs using the USART or SPI, confirm input levels and clock timing against the selected peripheral configuration and the maximum system clock in document 8246S.

Información de cumplimiento

RoHS
Compliant
REACH
Unknown
AEC-Q100
Not Applicable
Libre de plomo
Unknown
Libre de halógenos
Unknown
Minerales en conflicto
Unknown

A product listing identifies the ATTINY4313-SU as RoHS. The device is an industrial-compatible general-purpose microcontroller rather than an AEC-Q100 automotive-qualified variant.

Búsquedas relacionadas

attiny4313 datasheet attiny4313 pinout attiny4313 arduino attiny4313 pdf attiny4313 sur attiny4313 programming ATTINY4313-SU datasheet ATTINY4313-SU pinout ATTINY4313-SU equivalent ATTINY4313-SU replacement ATTINY4313-SU vs ATTINY2313A-SU ATTINY4313-SU price Microchip ATTINY4313-SU ATTINY4313-SU 20-pin SOIC

Componentes & términos relacionados

Microchip Technology ATTINY4313-SU ATTINY4313 ATTINY4313-SUR ATTINY2313A-SU ATTINY2313-SU TinyAVR AVR architecture 8-bit RISC microcontroller Integrated Circuits Microcontrollers Flash memory SRAM EEPROM Universal Serial Interface USART SPI single-wire debug interface 20-pin SOIC surface mount package 1.8 V to 5.5 V 20 MHz RoHS AVR538
RFQ de presupuesto rápido
Complete los detalles — nuestro equipo de ventas responderá en un plazo de 24 horas
Número de pieza Fabricante Encapsulado QTY Precio objetivo Total
✓
¡Presupuesto enviado!

Responderemos a su correo electrónico en un plazo de 24 horas

1
RFQ enviado
2
Presupuesto recibido
3
Pedido realizado
4
Pago
5
Enviado
6
Entregado
Ver detalles del RFQ