ATTINY4313-SU - 8-Bit AVR 20MHz 4KB Flash MCU | Microchip
MPN: ATTINY4313-SU ✓ 啟用中ATTINY4313-SU 概覽
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.
直接替換替代品,適用於 ATTINY4313-SU — 相同封裝,腳位對腳位相容。需重新設計 PCB 的不同封裝零件不列入。
此系列的變體
與下列產品可直接替換的同系列型號: ATTINY4313-SU (相同外形與佔位) — 差異在於 EEPROM, General-Purpose I/O Lines, General-Purpose Working Registers, Package, RoHS Status.
ATTINY4313-SUR
✅ 直接替換📋 參考替代品(不在目錄中)
ATTINY2313A-SU
✅ 直接替換聯絡詢價
查看資料表 →ATTINY2313-SU
✅ 直接替換📋 參考替代品(不在目錄中)
ATTINY4313-SU 最大額定值與電氣特性
| 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 |
| 封裝 | 20-pin SOIC |
| 安裝類型 | Surface Mount |
| RoHS 狀態 | RoHS |
ATTINY4313-SU 腳位配置
| 腳位 1 | PB4 — General-purpose I/O port B pin 4 |
| 腳位 2 | PB3 — General-purpose I/O port B pin 3 |
| 腳位 3 | PB2 — General-purpose I/O port B pin 2 |
| 腳位 4 | PB1 — General-purpose I/O port B pin 1 |
| 腳位 5 | PB0 — General-purpose I/O port B pin 0 |
| 腳位 6 | PA7 — General-purpose I/O port A pin 7 |
| 腳位 7 | PA6 — General-purpose I/O port A pin 6 |
| 腳位 8 | PA5 — General-purpose I/O port A pin 5 |
| 腳位 9 | PA4 — General-purpose I/O port A pin 4 |
| 腳位 10 | PA3 — General-purpose I/O port A pin 3 |
| 腳位 11 | PA2 — General-purpose I/O port A pin 2 |
| 腳位 12 | PA1 — General-purpose I/O port A pin 1 |
| 腳位 13 | PA0 — General-purpose I/O port A pin 0 |
| 腳位 14 | GND — Ground supply connection |
| 腳位 15 | PC5 — General-purpose I/O port C pin 5 |
| 腳位 16 | PC4 — General-purpose I/O port C pin 4 |
| 腳位 17 | PC3 — General-purpose I/O port C pin 3 |
| 腳位 18 | PC2 — General-purpose I/O port C pin 2 |
| 腳位 19 | PC1 — General-purpose I/O port C pin 1 |
| 腳位 20 | VCC — Positive supply voltage connection |
典型應用
ATTINY4313-SU 適用於 6 應用s: 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.
推薦
推薦產品摘要
工程參考資料,適用於 ATTINY4313-SU — 比較、設計指引及合規資訊。
選型指南
與替代品比較
| 參數 | 本產品 | 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 |
主要差異化特點
- Twice the program memory of ATtiny2313-class devices (對比ATTINY2313A-SU)
- Larger SRAM and EEPROM allocation (對比ATTINY2313-SU)
- Identical controller with automated-production reel option (對比ATTINY4313-SUR)
設計說明
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.
合規資訊
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.